private void ChangeUI(CallState state) { try { new ComMethods.SwitchOnType <CallState>(state) .Case <CallAgentClintConnectedState>(initiate => UiState.InCallAgentClintConnectedState()) .Case <CallAgentSupConnectedState>(i => UiState.InCallAgentSupConnectedState(state.CallAction)) .Case <CallConferenceState>(b => UiState.InCallConferenceState()) .Case <CallConnectedState>(b => UiState.InCallConnectedState()) .Case <CallIncommingState>(b => UiState.InCallIncommingState()) .Case <CallDisconnectedState>(b => UiState.InCallDisconnectedState()) .Case <CallHoldState>(b => UiState.InCallHoldState(state.CallAction)) .Case <CallIdleState>(b => UiState.InCallIdleState()) //.Case<CallRingingState>(b => UiState.InCallRingingState()) .Case <CallTryingState>(b => UiState.InCallTryingState()) .Default <CallIdleState>(t => UiState.InCallIdleState()); } catch (Exception exception) { Logger.Instance.LogMessage(Logger.LogAppender.DuoLogger3, "Call ChangeUI", exception, Logger.LogLevel.Error); } }