private void InitializeSafeService()
 {
     if (this.safetyService == null)
     {
         this.safetyService = this.RegisterNeedInputPasswordService(delegate
         {
             this.ContentGrid.Visibility = Visibility.Collapsed;
             if (base.ApplicationBar != null)
             {
                 base.ApplicationBar.IsVisible = false;
             }
         }, delegate(string msg)
         {
             this.ContentGrid.Visibility = Visibility.Visible;
             this.ContentGrid.Children.Clear();
             if (this.funcBar != null)
             {
                 this.funcBar.IsVisible = false;
             }
             this.saveAndContinue.IsEnabled = false;
             this.SaveAndCloseButton.IsEnabled = false;
             TextBlock block = new TextBlock
             {
                 Margin = new Thickness(12.0, 20.0, 2.0, 0.0),
                 FontSize = 48.0,
                 TextWrapping = TextWrapping.Wrap,
                 Text = msg
             };
             this.ContentGrid.Children.Add(block);
         }, delegate
         {
             if (this.funcBar != null)
             {
                 this.funcBar.IsVisible = true;
             }
             this.ContentGrid.Visibility = Visibility.Visible;
             App.HasLogined = true;
         });
     }
 }
Ejemplo n.º 2
0
 private void InitializeSafeService()
 {
     this.safetyService = new ApplicationSafetyService(this);
     this.safetyService.AfterPasswordPassed = new System.Action(this.AfterPasswordPassed);
     this.safetyService.BeforePopupPasswordInputDialog = delegate
     {
         this.AddAccountItemButton.Visibility = Visibility.Collapsed;
         this.SummaryPanoramaItem.Visibility = Visibility.Collapsed;
     };
     this.safetyService.AfterPasswordWrong = delegate(string msg)
     {
         if (base.NavigationService.CanGoBack)
         {
             base.NavigationService.GoBack();
         }
         else
         {
             this.mainPageViewModel.Items.Clear();
             this.SetMyAccountBookPageContent(LocalizedStrings.GetLanguageInfoByKey("PasswordWrongText"));
             this.MainPanorama.SelectionChanged -= new System.EventHandler<SelectionChangedEventArgs>(this.MainPanorama_SelectionChanged);
         }
     };
 }