A SIL.IProgress-compatible progress dialog which keeps the work in the foreground, using the progress calls by the worker to keep the UI alive. This has the advantage that any errors raised by the worker don't need special handling. NOTE: this dialog is more of an experiment: it doesn't normally work... it's a lot to ask the ui to freeze and still keep working by means of an occasionally hacked-in Application.DoEvents();
Inheritance: System.Windows.Forms.Form
コード例 #1
0
ファイル: EditingModel.cs プロジェクト: JohnThomson/testBloom
 public void CopyImageMetadataToWholeBook(Metadata metadata)
 {
     using (var dlg = new ProgressDialogForeground())//REVIEW: this foreground dialog has known problems in other contexts... it was used here because of its ability to handle exceptions well. TODO: make the background one handle exceptions well
     {
         dlg.ShowAndDoWork(progress => CurrentBook.CopyImageMetadataToWholeBookAndSave(metadata, progress));
     }
 }
コード例 #2
0
ファイル: LibraryModel.cs プロジェクト: JohnThomson/testBloom
        public void BringBookUpToDate()
        {
            var b = _bookSelection.CurrentSelection;
            _bookSelection.SelectBook(null);

            using (var dlg = new ProgressDialogForeground()) //REVIEW: this foreground dialog has known problems in other contexts... it was used here because of its ability to handle exceptions well. TODO: make the background one handle exceptions well
            {
                dlg.ShowAndDoWork(progress=>b.BringBookUpToDate(progress));
            }

            _bookSelection.SelectBook(b);
        }
コード例 #3
0
 /// <summary>
 /// Before calling this, ConfigurationData has to be loaded. E.g., by running ShowConfigurationDialog()
 /// </summary>
 /// <param name="bookPath"></param>
 public void ConfigureBook(string bookPath)
 {
     using (var dlg = new ProgressDialogForeground())
     {
         dlg.Text = L10NSharp.LocalizationManager.GetString("CollectionTab.ConfiguringBookMessage", "Building...");
         dlg.ShowAndDoWork((progress) => ConfigureBookInternal(bookPath));
     }
 }