Beispiel #1
0
        // 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);
                }
            }
        }
Beispiel #2
0
        // 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);
                }
            }
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }