private void DataToControls()
{
if (switchItem != null)
{
if (switchItem is MatrixSwitch)
{
matrixSwitchControl.MatrixSwitch = (MatrixSwitch) switchItem;
cmbSwitchType.SelectedIndex = cmbSwitchType.FindStringExact(MATRIX_SWITCH);
}
else if (switchItem is Switch)
{
switchControl.Switch = (Switch) switchItem;
cmbSwitchType.SelectedIndex = cmbSwitchType.FindStringExact(SWITCH);
}
else if (switchItem is CrossPointSwitch)
{
crossPointSwitchControl.CrossPointSwitch = (CrossPointSwitch) switchItem;
cmbSwitchType.SelectedIndex = cmbSwitchType.FindStringExact(CROSS_POINT_SWITCH);
}
//----------------------------------------------------------------------------------//
//--- We don't want the user to change the switch type once it has been created, ---//
//--- they'll need to delete it and create a new one to change the type. ---//
//----------------------------------------------------------------------------------//
cmbSwitchType.Enabled = false;
}
}