ATMLCommonLibrary.controls.signal.SignalControl.btnSelectOuts_Click C# (CSharp) Method

btnSelectOuts_Click() private method

private btnSelectOuts_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void btnSelectOuts_Click(object sender, EventArgs e)
        {
            if (_availableOuts != null)
            {
                //----------------------------------------------------------------------------------//
                //--- Pass in "name" as the property name from the port to use as the list value ---//
                //----------------------------------------------------------------------------------//
                var form = new CheckedListForm("name");
                foreach (Port port in _availableOuts)
                {
                    if (port.direction == PortDirection.Output
                        || port.direction == PortDirection.BiDirectional)
                    {
                        form.AddListItem(port, edtOut.Text.Contains(port.name));
                    }
                }

                if (DialogResult.OK == form.ShowDialog())
                {
                    List<object> selectedList = form.SelectedIems;
                    //---------------------------------//
                    //--- Clear any existing inputs ---//
                    //---------------------------------//
                    edtOut.Text = "";

                    //------------------------------------------------------//
                    //--- Walk each checked input from checked list form ---//
                    //------------------------------------------------------//
                    foreach (object item in selectedList)
                    {
                        var port = (Port) item;
                        //----------------------------------------------------------------------------------//
                        //--- Add output items to in line separated by a space (backwards compatability) ---//
                        //----------------------------------------------------------------------------------//
                        edtOut.Text += port.name + " ";
                    }
                }
            }
        }