Esempio n. 1
0
 private void buttonBeginDeployment_Click(object sender, EventArgs e)
 {
     buttonBeginDeployment.Enabled = false;
     Task.Run(() => { AddonsBackup.DeployArchive(pathsToArchives[comboBoxArchives.SelectedIndex]); }).ContinueWith(task =>
     {
         this.TaskDialog("Operation successful", "", NotifyUserType.Info);
         buttonBeginDeployment.Enabled = true;
     });
 }
Esempio n. 2
0
 public AddonsBackupDeploy()
 {
     InitializeComponent();
     StyleManager.Style = Settings2.Instance.StyleColor;
     pathsToArchives    = AddonsBackup.GetArchives();
     foreach (string archive in pathsToArchives)
     {
         string fileName = Path.GetFileNameWithoutExtension(archive);
         // ReSharper disable once PossibleNullReferenceException
         string   s        = fileName.Replace("AddonsBackup_", "");
         DateTime dateTime = DateTime.ParseExact(s, "yyyyMMdd_HHmmss", CultureInfo.InvariantCulture);
         comboBoxArchives.Items.Add(dateTime.ToString());
     }
     progressBarExtract.Visible              = false;
     AddonsBackup.IsRunningChanged          += AddonsBackup_IsRunningChanged;
     AddonsBackup.ProgressPercentageChanged += AddonsBackup_ProgressPercentageChanged;
 }