Exemple #1
0
 private void ChangeUI(AgentEvent state)
 {
     try
     {
         new ComMethods.SwitchOnType <AgentEvent>(state)
         .Case <AgentInitiate>(initiate =>
         {
             UiState.InInitiateState();
         })
         .Case <AgentIdle>(i =>
         {
             UiState.InAgentIdleState(null);
         })
         .Case <AgentBusy>(b =>
         {
             UiState.InAgentBusy(CallDirection);
         })
         .Case <AgentAcw>(b =>
         {
             UiState.InAgentAcwState();
         })
         .Case <AgentBreak>(b =>
         {
             UiState.InBreakState();
         })
         .Case <AgentOffline>(b => UiState.InOfflineState(StatusText, ErrorMsg, StatusCode))
         .Default <AgentEvent>(t => UiState.InOfflineState(StatusText, ErrorMsg, StatusCode));
     }
     catch (Exception exception)
     {
         Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger2, "Agent ChangeUI", exception, Logger.LogLevel.Error);
     }
 }
Exemple #2
0
 private void ChangeUI(AgentEvent state)
 {
     try
     {
         new ComMethods.SwitchOnType <AgentEvent>(state)
         .Case <AgentInitiate>(initiate =>
         {
             UiState.InInitiateState();
         })
         .Case <AgentIdle>(i =>
         {
             ardsHandler.SendStatusChangeRequestIdel(Auth, CallSessionId, IsCallAnswer);
         })
         .Case <AgentBusy>(b =>
         {
             UiState.InAgentBusy(CallDirection);
             if (CallDirection == CallDirection.Incoming)
             {
                 ardsHandler.ResourceStatusChangeBusy(Auth, CallSessionId, IsCallAnswer);
             }
         })
         .Case <AgentAcw>(b =>
         {
             UiState.InAgentAcwState();
             ardsHandler.ResourceStatusChangeAcw(Auth, CallSessionId, IsCallAnswer);
         })
         .Case <AgentBreak>(b =>
         {
             UiState.InBreakState();
         })
         .Case <AgentOffline>(b => UiState.InOfflineState(StatusText, ErrorMsg, StatusCode))
         .Default <AgentEvent>(t => UiState.InOfflineState(StatusText, ErrorMsg, StatusCode));
     }
     catch (Exception exception)
     {
         Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger2, "Agent ChangeUI", exception, Logger.LogLevel.Error);
     }
 }