Ejemplo n.º 1
0
        /// <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;
            }
        }
Ejemplo n.º 2
0
        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;
                    }
                }));
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Saves current state for future use
 /// </summary>
 /// <param name="state">New application state.</param>
 public void SetCurrentState(Enums.ApplicationState state)
 {
     _currentState = state;
 }
Ejemplo n.º 4
0
 /// <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);
 }
Ejemplo n.º 5
0
 /// <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);
 }
Ejemplo n.º 6
0
 public void SwitchToState(Enums.ApplicationState state)
 {
     deviceManagementPage.SwitchToState(state);
     mediaPage.SwitchToState(state);
     ptzPage.SwitchToState(state);
 }
Ejemplo n.º 7
0
 /// <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);
 }
Ejemplo n.º 8
0
 /// <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));
 }
Ejemplo n.º 9
0
 public void SwitchToState(Enums.ApplicationState state)
 {
 }