예제 #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);
                }
            }
        }
예제 #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);
                }
            }
        }
예제 #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);
        }
예제 #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);
        }