ATMLCommonLibrary.controls.common.PortControl.ControlsToData C# (CSharp) Method

ControlsToData() private method

private ControlsToData ( ) : void
return void
        private void ControlsToData()
        {
            if (_port == null)
                _port = new Port();
            _port.name = edtName.Text;

            if (cmbPortType.SelectedIndex > 0)
            {
                _port.type = (PortType) Enum.Parse( typeof (PortType), (string) cmbPortType.SelectedItem );
            }
            else
            {
                _port.typeSpecified = false;
            }

            if (cmbPortDirection.SelectedIndex > 0)
            {
                _port.direction = (PortDirection)Enum.Parse( typeof (PortDirection), (string) cmbPortDirection.SelectedItem );
            }
            else
            {
                _port.directionSpecified = false;
            }

            //TODO: Address when/if we handle extensions
            _port.Extension = null;
        }