コード例 #1
0
 private void logout_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         // Delete the cache
         SyncContextInstance.Context.ClearCache();
     }
     finally
     {
         SettingsViewModel.Instance.UserId   = Guid.Empty;
         SettingsViewModel.Instance.UserName = null;
         SyncContextInstance.ClearContext();
         SettingsViewModel.SaveSettingsFile();
         NavigationService.Navigate(new Uri("/Bootstrapview.xaml", UriKind.Relative));
     }
 }
コード例 #2
0
 void CacheController_RefreshCompleted(object sender, Microsoft.Synchronization.ClientServices.RefreshCompletedEventArgs e)
 {
     if (e.Error != null)
     {
         Dispatcher.BeginInvoke(() =>
         {
             this.loadErrorTextBlk.Text       = e.Error.Message;
             this.loadErrorTextBlk.Visibility = System.Windows.Visibility.Visible;
         });
     }
     else
     {
         SyncContextInstance.Context.CacheController.RefreshCompleted -= CacheController_RefreshCompleted;
         SyncContextInstance.AddStats(e.Statistics, e.Error);
         Dispatcher.BeginInvoke(() => this.popupPanel.IsOpen = false);
     }
     StopTimer();
 }