private void OnProcessFileDialog(object sender, FileDialogEventArgs e)
 {
     switch (e.Mode)
     {
     case FileDialogMode.Save:
         using (var saveDialog = new SaveFileDialog())
         {
             saveDialog.Title            = e.Title;
             saveDialog.Filter           = e.Filter;
             saveDialog.FileName         = Path.GetFileName(e.DefaultFileName);
             saveDialog.InitialDirectory = Path.Combine(
                 Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
                 "Downloads");
             if (saveDialog.ShowDialog(_siteContainer.ParentBundle.MainForm) != DialogResult.Cancel)
             {
                 FormDownloadProgress.ShowProgress(_siteContainer.ParentBundle.MainForm);
                 Application.DoEvents();
                 FormDownloadProgress.SetTitle("Downloading…");
                 Application.DoEvents();
                 FormDownloadProgress.SetDetails(Path.GetFileName(saveDialog.FileName));
                 Application.DoEvents();
                 _siteContainer.SuspendPages();
                 Application.DoEvents();
                 e.Continue(saveDialog.FileName);
             }
             else
             {
                 e.Cancel();
             }
         }
         break;
     }
     e.Handled = true;
 }
 private void OnWebViewDownloadUpdated(object sender, DownloadEventArgs e)
 {
     Application.DoEvents();
     FormDownloadProgress.SetDetails(String.Format("{0} - {1}%", Path.GetFileName(e.Item.FullPath), e.Item.PercentageComplete));
     Application.DoEvents();
 }