Пример #1
0
 public SoftPhoneStateProxy(ISoftPhoneState state, Action<IInternalSoftPhone, SipRequestEvent> afterProcessRequest, Action<IInternalSoftPhone, SipResponseEvent> afterProcessResponse, Action<IInternalSoftPhone> afterInitialized)
 {
     _state = state;
     _afterProcessRequest = afterProcessRequest;
     _afterProcessResponse = afterProcessResponse;
     _afterInitialized = afterInitialized;
 }
Пример #2
0
 public SoftPhoneStateProxy(ISoftPhoneState state)
 {
     _state = state;
     _afterProcessRequest = delegate { };
     _afterProcessResponse = delegate { };
     _afterInitialized = delegate { };
 }
Пример #3
0
 public SoftPhoneStateProxy(ISoftPhoneState state, Action <IInternalSoftPhone, SipRequestEvent> afterProcessRequest, Action <IInternalSoftPhone, SipResponseEvent> afterProcessResponse, Action <IInternalSoftPhone> afterInitialized)
 {
     _state = state;
     _afterProcessRequest  = afterProcessRequest;
     _afterProcessResponse = afterProcessResponse;
     _afterInitialized     = afterInitialized;
 }
Пример #4
0
 public SoftPhoneStateProxy(ISoftPhoneState state)
 {
     _state = state;
     _afterProcessRequest  = delegate { };
     _afterProcessResponse = delegate { };
     _afterInitialized     = delegate { };
 }
Пример #5
0
        public void ChangeState(ISoftPhoneState state)
        {
            Check.IsTrue(!state.Equals(InternalState), string.Format("Can not change state to '{0}'. The phone is already in '{0}' state", this.InternalState.GetType().Name));

            InternalState.Terminate(this);

            state.Initialize(this);

            InternalState = state;

            state.AfterInitialize(this);
            /*fire internal event*/
            InternalStateChanged(this, new EventArgs());
        }
Пример #6
0
        public void ChangeState(ISoftPhoneState state)
        {
            Check.IsTrue(!state.Equals(InternalState), string.Format("Can not change state to '{0}'. The phone is already in '{0}' state",  this.InternalState.GetType().Name));

            InternalState.Terminate(this);

            state.Initialize(this);

            InternalState = state;
            
            state.AfterInitialize(this);
            /*fire internal event*/
            InternalStateChanged(this, new EventArgs());
        }