コード例 #1
0
        public ExceptionWindow(Exception exception) : this()
        {
            this.exception = exception;

            ExolutioException xe = exception as ExolutioException;

            tbExMsg.Content = exception.Message;
            if (xe != null)
            {
                tbExInner.Content    = String.Empty;
                expander1.Visibility = Visibility.Collapsed;
                textBlock1.Content   = xe.ExceptionTitle;
                if (!string.IsNullOrEmpty(xe.ExceptionTitle))
                {
                    this.Title = xe.ExceptionTitle;
                }
                button1.Content    = "Ok";
                button2.Visibility = Visibility.Collapsed;
            }
            else
            {
                if (exception.InnerException != null)
                {
                    tbExInner.Content = "Inner exception: " + exception.InnerException.Message;
                }
                else
                {
                    tbExInner.Content = String.Empty;
                }
            }
        }
コード例 #2
0
        public ExceptionWindow(Exception exception)
            : this()
        {
            this.exception = exception;

            ExolutioException xe = exception as ExolutioException;

            tbExMsg.Content = exception.Message;
            if (xe != null)
            {
                tbExInner.Content    = String.Empty;
                expander1.Visibility = Visibility.Collapsed;
                if (xe.ExceptionTitle != null)
                {
                    textBlock1.Content = xe.ExceptionTitle;
                }
                if (!string.IsNullOrEmpty(xe.ExceptionTitle))
                {
                    this.Title = xe.ExceptionTitle;
                }
                button1.Content    = "Ok";
                button2.Visibility = Visibility.Collapsed;
                if (xe is Exolutio.Controller.Commands.ExolutioCommandException)
                {
                    if (string.IsNullOrEmpty(xe.ExceptionTitle))
                    {
                        textBlock1.Content = "Operation can not continue.";
                    }
                    Exolutio.Controller.Commands.ExolutioCommandException xec = ((Exolutio.Controller.Commands.ExolutioCommandException)xe);
                    if (xec.Command != null && xec.Command.ErrorDescription != null)
                    {
                        tbExInner.Content = xec.Command.ErrorDescription;
                    }
                }

                if (exception.InnerException != null)
                {
                    tbExInner.Content    = "Inner exception: " + exception.InnerException.Message;
                    expander1.Visibility = Visibility.Visible;
                }
            }
            else
            {
                if (exception.InnerException != null)
                {
                    tbExInner.Content = "Inner exception: " + exception.InnerException.Message;
                }
                else
                {
                    tbExInner.Content = String.Empty;
                }
            }
        }