private void btnOk_Click(object sender, EventArgs e)
{
sourcePort.MappedPorts.Clear();
foreach (ListViewItem lvi in lvResourcePorts.Items)
{
if (lvi.Checked)
{
ListViewGroup grp = lvi.Group;
var resource = (Resource) grp.Tag;
var port = (Port) lvi.Tag;
sourcePort.MappedPorts.Add(resource.name + "." + port.name, port);
}
}
}