private void ControlsToData()
{
if (_port == null)
_port = new TriggerPort();
_port.name = edtName.Text;
_port.type = (TriggerPortType)Enum.Parse(typeof(TriggerPortType), (string)cmbPortType.SelectedItem);
_port.direction = (PortDirection)Enum.Parse(typeof(PortDirection), (string)cmbPortDirection.SelectedItem);
_port.Description = edtDescription.Text;
}