Exemplo n.º 1
0
 /// <summary>
 /// Handles the form being shown or hidden
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void frmSorting_VisibleChanged(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         SetupForm();
         FadeInControls();
         this.Refresh();
         // Try a full backup
         if (!BackupEngine.FullBackup("Till_Software_Start"))
         {
             // If the backup failed, tell the user
             lblCurrentlyDoing.Text      = "Backup failed, see the log for more information";
             lblCurrentlyDoing.ForeColor = Color.Red;
             this.Refresh();
             // Wait 10 seconds so that the user has time to see the message
             System.Threading.Thread.Sleep(10000);
         }
         else
         {
             lblCurrentlyDoing.Text = "Deleting old backup data";
             this.Refresh();
             BackupEngine.RemoveOldFiles();
         }
         FadeOutControls();
         this.Close();
     }
 }
Exemplo n.º 2
0
 void frmSorting_VisibleChanged(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         SetupForm();
         FadeInControls();
         this.Refresh();
         if (!BackupEngine.FullBackup("Till_Software_Start"))
         {
             lblCurrentlyDoing.Text      = "Backup failed, see the log for more information";
             lblCurrentlyDoing.ForeColor = Color.Red;
             this.Refresh();
             System.Threading.Thread.Sleep(10000);
         }
         else
         {
             lblCurrentlyDoing.Text = "Deleting old backup data";
             this.Refresh();
             BackupEngine.RemoveOldFiles();
         }
         FadeOutControls();
         this.Close();
     }
 }