private void sipService_onStackEvent(object sender, StackEventArgs e) { if (this.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new EventHandler <StackEventArgs>(this.sipService_onStackEvent), sender, new object[] { e }); return; } switch (e.Type) { // for test, 正常情况下,需要全部放开注释 //case StackEventTypes.START_OK: //case StackEventTypes.START_NOK: //case StackEventTypes.STOP_NOK: //case StackEventTypes.STOP_OK: // this.screenService.SetProgressInfo("登录失败:请输入正确的用户名和密码"); // if (this.sipService.SipStack.State == MySipStack.STACK_STATE.STOPPED) // { // this.screenService.HideAllExcept(ScreenType.Options | ScreenType.Authorizations); // this.screenService.Show(ScreenType.Authentication, 0); // } // break; } }
private void sipService_onStackEvent(object sender, StackEventArgs e) { if (this.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new EventHandler <StackEventArgs>(this.sipService_onStackEvent), sender, new object[] { e }); return; } switch (e.Type) { case StackEventTypes.START_OK: case StackEventTypes.START_NOK: case StackEventTypes.STOP_NOK: case StackEventTypes.STOP_OK: this.screenService.SetProgressInfo(e.Phrase); break; } }
public void OnStackEvent(object sender, StackEventArgs e) { switch (e.Type) { case StackEventTypes.START_OK: if (this.anStatus == ANStatus.STACK_STARTING) { this.anStatus = ANStatus.STACK_STARTED; if (this.regSession == null) { this.regSession = new MyRegistrationSession(this.serviceManager.StackService.SipStack); } this.regSession.SigCompId = this.serviceManager.StackService.SipStack.SigCompId; this.regSession.FromUri = this.serviceManager.StackService.SipStack.SelfPreferences.impu; this.regSession.register(); } break; case StackEventTypes.STARING: this.anStatus = ANStatus.STACK_STARTING; break; case StackEventTypes.START_NOK: this.anStatus = ANStatus.IDLE; break; case StackEventTypes.STOP_OK: this.anStatus = ANStatus.IDLE; break; case StackEventTypes.STOPPING: this.anStatus = ANStatus.STACK_STOPPING; break; case StackEventTypes.STOP_NOK: this.anStatus = ANStatus.STACK_STOPPING; break; } EventHandlerTrigger.TriggerEvent <AccessNetworkEventArgs>(this.onAccessNetworkEvent, this, new AccessNetworkEventArgs(AccessNetworkEventTypes.ANET_LOGIN, this.anStatus, e.Phrase)); }
private void sipService_onStackEvent(object sender, StackEventArgs e) { if (this.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new EventHandler <StackEventArgs>(this.sipService_onStackEvent), sender, new object[] { e }); return; } switch (e.Type) { case StackEventTypes.START_OK: case StackEventTypes.START_NOK: case StackEventTypes.STOP_NOK: case StackEventTypes.STOP_OK: this.screenService.SetProgressInfo(e.Phrase); if (this.sipService.SipStack.State == MySipStack.STACK_STATE.STOPPED) { this.screenService.HideAllExcept(ScreenType.Options | ScreenType.Authorizations); this.screenService.Show(ScreenType.Authentication, 0); } break; } }
protected virtual void OnStackChanged(StackEventArgs a) { stackEvent(this, a); }
public virtual void OnStackChanged(StackEventArgs a) { stackEvent(this, a); }
//Creating a code that should occure when the event happens public void StackChange(object sender, StackEventArgs e) { Console.WriteLine("Stack Event call {0} {1}", e.obj, e.strEvent); }