Example #1
0
 /// <summary>
 /// Called when [backup completed].
 /// </summary>
 /// <param name="backupFilename">The backup filename.</param>
 /// <remarks>Documented by Dev02, 2008-09-08</remarks>
 private void OnBackupCompleted(string backupFilename)
 {
     if (BackupCompleted != null)
     {
         BackupCompletedEventArgs e = new BackupCompletedEventArgs();
         e.BackupFilename = backupFilename;
         BackupCompleted(this, e);
     }
 }
 private void serverProxy_BackupCompleted(object sender, BackupCompletedEventArgs e)
 {
     System.Action action = null;
     DataSynchronizationInfo data;
     if (e.Error != null)
     {
         this.ProcessError(this.datatransferingStep, e.Error);
     }
     else if (!e.Result)
     {
         this.datatransferingStep.Failed();
     }
     else
     {
         data = e.UserState as DataSynchronizationInfo;
         if (data != null)
         {
             if (action == null)
             {
                 action = delegate
                 {
                     string text = data.GetMessage();
                     if (DataSynchronizationHandler.ToBackupDataBase)
                     {
                         this.needRestart = true;
                         this.Alert(text, null);
                         if (NeedToConfirmRebuildDatabase && (this.AlertConfirm(AppResources.EnsureToRebuildDatabase, null, null) == MessageBoxResult.OK))
                         {
                             AppUpdater.ForceRebuildDatabase();
                         }
                         this.Alert(AppResources.RequireRestartAppMessage, null);
                     }
                     else
                     {
                         this.Alert(text, null);
                     }
                 };
             }
             this.InvokeInThread(action);
         }
         this.datatransferingStep.Success();
         this.dataCheckingStep.Start();
         this.dataCheckingStep.Success();
         this.serverProxy.CloseAsync();
     }
 }