/// <summary> /// /// </summary> /// <remarks>Management page has no effect on Discovery, so here use logic different from state.IsActive</remarks> /// <param name="state"></param> public override void SwitchToState(Enums.ApplicationState state) { _currentState = state; scSettings.SwitchToState(state); switch (state) { case Enums.ApplicationState.CommandRunning: case Enums.ApplicationState.TestRunning: case Enums.ApplicationState.TestPaused: case Enums.ApplicationState.DiscoveryRunning: case Enums.ApplicationState.ConformanceTestRunning: BeginInvoke(new Action(() => DisablePage())); break; case Enums.ApplicationState.Idle: BeginInvoke(new Action(() => EnablePage())); break; } }
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; } })); } }
/// <summary> /// Saves current state for future use /// </summary> /// <param name="state">New application state.</param> public void SetCurrentState(Enums.ApplicationState state) { _currentState = state; }
/// <summary> /// Enables passwords controls. /// </summary> /// <param name="currentState">Application state.</param> public void EnablePasswords(Enums.ApplicationState currentState) { tbPassword1.Enabled = !rbEmbeddedPasswords.Checked && (currentState == Enums.ApplicationState.Idle); tbPassword2.Enabled = !rbEmbeddedPasswords.Checked && (currentState == Enums.ApplicationState.Idle); }
/// <summary> /// Switches to the current application state. /// </summary> /// <param name="state">New state</param> public virtual void SwitchToState(Enums.ApplicationState state) { _currentState = state; View.SwitchToState(state); }
public void SwitchToState(Enums.ApplicationState state) { deviceManagementPage.SwitchToState(state); mediaPage.SwitchToState(state); ptzPage.SwitchToState(state); }
/// <summary> /// Checks if application is not in one of "long operation" states. /// </summary> /// <param name="state"></param> /// <returns></returns> public static bool IsActive(this Enums.ApplicationState state) { return(state != Enums.ApplicationState.Idle); }
/// <summary> /// Switches tab to the state specified. /// </summary> /// <param name="state">New state</param> public override void SwitchToState(Enums.ApplicationState state) { DoWithAll(controller => controller.SwitchToState(state)); }
public void SwitchToState(Enums.ApplicationState state) { }