// NOTE: This is called on a different thread from the dialog! public void LoadingComplete(bool success, string errorMessage) { complete = true; this.success = success; this.errorMessage = errorMessage; if (dialog == null || !dialog.IsHandleCreated) { return; } if (success) { dialog.Invoke((Action) delegate { dialog.Close(); dialog.Dispose(); dialog = null; }); } else { dialog.Invoke((Action) delegate { dialog.ShowErrorMessage(errorMessage); }); // Wait for user to hit cancel button. while (dialog != null && dialog.Visible) { Thread.Sleep(50); } } }
// NOTE: This is called on a different thread from the dialog! public void LoadingComplete(bool success, string errorMessage) { complete = true; this.success = success; this.errorMessage = errorMessage; if (dialog == null || dialog.Handle == IntPtr.Zero) return; if (success) { dialog.Invoke((Action)delegate { dialog.Close(); dialog.Dispose(); dialog = null; }); } else { dialog.Invoke((Action)delegate { dialog.ShowErrorMessage(errorMessage); }); // Wait for user to hit cancel button. while (dialog != null && dialog.Visible) { Thread.Sleep(50); } } }
public bool ShowLoadingStatus(string fileName) { dialog = new PdfConversionInProgress(); if (complete) { if (success) return true; else dialog.ShowErrorMessage(errorMessage); } DialogResult result = dialog.ShowDialog(); return (dialog == null || dialog.DialogResult != DialogResult.Cancel); }
public bool ShowLoadingStatus(string fileName) { dialog = new PdfConversionInProgress(); if (complete) { if (success) { return(true); } else { dialog.ShowErrorMessage(errorMessage); } } DialogResult result = dialog.ShowDialog(); return(dialog == null || dialog.DialogResult != DialogResult.Cancel); }