public override void SwitchToState(Enums.ApplicationState state) { if (state.IsActive()) { EnableControls(false); } else { EnableControls(true); } }
public void SwitchToState(Enums.ApplicationState state) { if (state.IsActive()) { BeginInvoke(new Action(() => EnableFunctions(false))); } else { BeginInvoke(new Action(() => EnableFunctions(_controller.DeviceNotEmpty() && !_controller.RequestPending))); } }
/// <summary> /// Switches control to specified state /// </summary> /// <param name="state">New state</param> public void SwitchToState(Enums.ApplicationState state) { if (state.IsActive()) { Invoke(new Action(() => EnableControls(false))); } else { Invoke(new Action(() => EnableControls(true))); } }
public void SwitchToState(Enums.ApplicationState state) { Control[] controls = new Control[] { cmbService, tbServiceAddress, tvTemplates, btnAddRequestToTemplates, btnSendRequest, btnRequestFile, tbRequestFile, tbRequest, tbResponse }; if (state.IsActive()) { BeginInvoke(new Action(() => { DisableControls(controls); btnDelete.Enabled = false; })); } else { BeginInvoke(new Action(() => { EnableControls(controls); TreeNode node = tvTemplates.SelectedNode; if (node != null) { RequestFile file = node.Tag as RequestFile; btnDelete.Enabled = (file != null); } else { btnDelete.Enabled = false; } })); } }