Example #1
0
 private void OpenConstructor()
 {
     Hide();
     using (var ctor = new DatabaseConstructorDialog())
     {
         ctor.ShowDialog();
         if (!(ctor.Back || ctor.Cancel))
         {
             Settings.SetLastSource(ctor.Source);
             Settings.SetLastDatabase(ctor.Destination);
             var updater = new DatabaseUpdater(ctor.Destination, ctor.SelectedFiles);
             using (var dlg = new DatabaseUpdaterDialog(updater))
             {
                 dlg.ShowDialog();
             }
         }
     }
     Show();
     BringToFront();
     Activate();
 }
 public DatabaseUpdaterDialog(DatabaseUpdater updater)
 {
     InitializeComponent();
     this.updater = updater;
     ConnectUpdater();
 }
 private void OnGlobalProgressChanged(DatabaseUpdater.GlobalProgressInfo info)
 {
     if (info.Startup)
     {
         InvokeAsync(() =>
         {
             pbProgress.Minimum = 0;
             pbProgress.Maximum = (int)info.Progress.Maximum;
             pbProgress.Value   = 0;
         });
         return;
     }
     var fileName = Path.GetFileName(info.File);
     var counter = String.Format("({0}/{1})", (info.Progress.Current + 1), info.Progress.Maximum);
     InvokeAsync(() =>
     {
         lCurrentFile.Text = fileName;
         tbCounter.Text = counter;
         pbProgress.Value = (int)info.Progress.Current;
         Text = String.Format("{0} ({1}%)", StringTable.UpdatingDatabase, info.Progress.Percentage);
     });
 }