ATMLCommonLibrary.controls.equipment.TestStationControl.TestStationControl_Validating C# (CSharp) Method

TestStationControl_Validating() public method

public TestStationControl_Validating ( object sender, CancelEventArgs e ) : void
sender object
e CancelEventArgs
return void
        void TestStationControl_Validating(object sender, CancelEventArgs e)
        {
            TestStationDescription testStationDescription = TestStationDescription;
            if (testStationDescription != null)
            {
                testStationDescriptionInstrumentListControl1.HasErrors = false;
                errorProvider.SetError(testStationDescriptionInstrumentListControl1, "");
                if (testStationDescription.Instruments == null || testStationDescription.Instruments.Count == 0)
                {
                    errorProvider.SetError(testStationDescriptionInstrumentListControl1,
                                            Resources.errMsg_You_must_add_at_least_one_instrument );
                    tabInstruments.ToolTipText = Resources.errMsg_You_must_add_at_least_one_instrument;
                    testStationDescriptionInstrumentListControl1.HasErrors = true;
                    e.Cancel = true;
                    OnError(sender, errorProvider.GetError(testStationDescriptionInstrumentListControl1));
                }
            }
        }