/// <summary> /// Updates the state of the current AcdCustomerSession /// </summary> private void UpdateState(SupervisorSessionState state) { SupervisorSessionState previousState = _state; lock (_syncRoot) { switch (state) { case SupervisorSessionState.Incoming: _state = state; break; case SupervisorSessionState.GeneralAgentActivityTracking: if (_state == SupervisorSessionState.JoiningCustomerSession || _state == SupervisorSessionState.Incoming || _state == SupervisorSessionState.AgentMonitoring) { _state = state; } break; case SupervisorSessionState.JoiningCustomerSession: if (_state == SupervisorSessionState.GeneralAgentActivityTracking) { _state = state; } break; case SupervisorSessionState.AgentMonitoring: if (_state == SupervisorSessionState.JoiningCustomerSession) { _state = state; } break; case SupervisorSessionState.Terminating: if (_state < SupervisorSessionState.Terminating) { _state = state; } break; case SupervisorSessionState.Terminated: if (_state == SupervisorSessionState.Terminating) { _state = state; } break; } } EventHandler <SupervisorSessionStateChangedEventArgs> handler = this.StateChanged; if (handler != null) { handler(this, new SupervisorSessionStateChangedEventArgs(previousState, state)); } }
internal SupervisorSessionStateChangedEventArgs(SupervisorSessionState previousState, SupervisorSessionState newState) { _previousState = previousState; _newState = newState; }