ATMLCommonLibrary.controls.resource.ResourcePortSelectionForm.btnOk_Click C# (CSharp) Method

btnOk_Click() private method

private btnOk_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        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);
                }
            }
        }