public SoftPhoneStateProxy(ISoftPhoneState state, Action<IInternalSoftPhone, SipRequestEvent> afterProcessRequest, Action<IInternalSoftPhone, SipResponseEvent> afterProcessResponse, Action<IInternalSoftPhone> afterInitialized) { _state = state; _afterProcessRequest = afterProcessRequest; _afterProcessResponse = afterProcessResponse; _afterInitialized = afterInitialized; }
public SoftPhoneStateProxy(ISoftPhoneState state) { _state = state; _afterProcessRequest = delegate { }; _afterProcessResponse = delegate { }; _afterInitialized = delegate { }; }
public SoftPhoneStateProxy(ISoftPhoneState state, Action <IInternalSoftPhone, SipRequestEvent> afterProcessRequest, Action <IInternalSoftPhone, SipResponseEvent> afterProcessResponse, Action <IInternalSoftPhone> afterInitialized) { _state = state; _afterProcessRequest = afterProcessRequest; _afterProcessResponse = afterProcessResponse; _afterInitialized = afterInitialized; }
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()); }