void sipService_onRegistrationEvent(object sender, BogheCore.Sip.Events.RegistrationEventArgs e) { if (this.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new EventHandler <RegistrationEventArgs>(this.sipService_onRegistrationEvent), sender, new object[] { e }); return; } switch (e.Type) { case RegistrationEventTypes.REGISTRATION_INPROGRESS: case RegistrationEventTypes.UNREGISTRATION_INPROGRESS: break; case RegistrationEventTypes.REGISTRATION_NOK: case RegistrationEventTypes.REGISTRATION_OK: case RegistrationEventTypes.UNREGISTRATION_NOK: case RegistrationEventTypes.UNREGISTRATION_OK: break; } }
private void sipService_onRegistrationEvent(object sender, RegistrationEventArgs e) { if (this.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new EventHandler<RegistrationEventArgs>(this.sipService_onRegistrationEvent), sender, new object[] { e }); return; } switch (e.Type) { case RegistrationEventTypes.REGISTRATION_INPROGRESS: this.screenService.SetProgressInfo("Trying to Sign In..."); // indicators this.imageIndicatorConn.Source = MyImageConverter.FromBitmap(Properties.Resources.bullet_ball_glass_grey_24); break; case RegistrationEventTypes.REGISTRATION_NOK: this.screenService.SetProgressInfo(e.Phrase); break; case RegistrationEventTypes.REGISTRATION_OK: this.screenService.SetProgressInfo("Signed In"); // Screens this.screenService.Hide(ScreenType.Authentication); this.screenService.Show(ScreenType.History, 1); this.screenService.Show(ScreenType.Contacts, 0); // Menus this.MenuItemFile_SignIn.IsEnabled = false; this.MenuItemFile_SignOut.IsEnabled = true; this.MenuItemFile_Registrations.IsEnabled = true; this.MenuItemEAB.IsEnabled = true; this.MenuItemHistory.IsEnabled = true; // indicators this.imageIndicatorConn.Source = MyImageConverter.FromBitmap(Properties.Resources.bullet_ball_glass_green_24); // Sound alert this.soundService.PlayConnectionChanged(true); break; case RegistrationEventTypes.UNREGISTRATION_INPROGRESS: this.screenService.SetProgressInfo("Trying to Sign Out..."); // indicators this.imageIndicatorConn.Source = MyImageConverter.FromBitmap(Properties.Resources.bullet_ball_glass_grey_24); break; case RegistrationEventTypes.UNREGISTRATION_NOK: this.screenService.SetProgressInfo(e.Phrase); break; case RegistrationEventTypes.UNREGISTRATION_OK: this.screenService.SetProgressInfo("Signed Out"); // Screens //new Thread(delegate() //{ this.screenService.HideAllExcept(ScreenType.Options | ScreenType.Authorizations); this.screenService.Show(ScreenType.Authentication, 0); //}).Start(); // Menus this.MenuItemFile_SignIn.IsEnabled = true; this.MenuItemFile_SignOut.IsEnabled = false; this.MenuItemFile_Registrations.IsEnabled = false; this.MenuItemEAB.IsEnabled = false; this.MenuItemHistory.IsEnabled = false; //... this.registrations.Clear(); this.watchers.Clear(); // indicators this.imageIndicatorConn.Source = MyImageConverter.FromBitmap(Properties.Resources.bullet_ball_glass_red_24); // Sound alert this.soundService.PlayConnectionChanged(false); break; } }
private void sipService_onRegistrationEvent(object sender, RegistrationEventArgs e) { if (this.Dispatcher.Thread != Thread.CurrentThread) { this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new EventHandler<RegistrationEventArgs>(this.sipService_onRegistrationEvent), sender, new object[] { e }); return; } switch (e.Type) { case RegistrationEventTypes.REGISTRATION_INPROGRESS: case RegistrationEventTypes.UNREGISTRATION_INPROGRESS: this.buttonCancel.IsEnabled = true; this.buttonSignIn.IsEnabled = false; break; case RegistrationEventTypes.REGISTRATION_NOK: case RegistrationEventTypes.REGISTRATION_OK: case RegistrationEventTypes.UNREGISTRATION_NOK: case RegistrationEventTypes.UNREGISTRATION_OK: this.buttonCancel.IsEnabled = false; this.buttonSignIn.IsEnabled = true; this.buttonSignIn.Content = this.sipService.IsRegistered ? "Sign Out" : "Sign In"; break; } }
private void sipService_onRegistrationEvent(object sender, RegistrationEventArgs e) { switch (e.Type) { case RegistrationEventTypes.REGISTRATION_OK: { this.Download(); break; } case RegistrationEventTypes.UNREGISTRATION_OK: { #if !WINRT if (this.sipService.IsXcapEnabled) { this.xcapService.UnPrepare(); } else #endif { } break; } case RegistrationEventTypes.REGISTRATION_NOK: case RegistrationEventTypes.REGISTRATION_INPROGRESS: case RegistrationEventTypes.UNREGISTRATION_NOK: case RegistrationEventTypes.UNREGISTRATION_INPROGRESS: break; } }