Smrf.NodeXL.ExcelTemplate.ErrorUtil.OnException C# (CSharp) Method

OnException() public static method

public static OnException ( Exception exception ) : void
exception System.Exception
return void
    OnException
    (
        Exception exception
    )
    {
        Debug.Assert(exception != null);

        if (exception is WorkbookFormatException)
        {
            OnWorkbookFormatException( (WorkbookFormatException)exception );
            return;
        }

        FormUtil.ShowWarning( String.Format(

            "An unexpected problem occurred.  If it occurs again, please"
            + " copy the details to the clipboard by typing Ctrl-C, then"
            + " post the details to {0}."
            + "\r\n\r\n"
            + "Details:\r\n\r\n"
            + "{1}"
            + "\r\n\r\n"
            + "{2}"
            ,
            ProjectInformation.DiscussionPageUrl,
            ExceptionUtil.GetMessageTrace(exception),
            exception.StackTrace
            ) );
    }

Usage Example

コード例 #1
0
        GraphMetricsAggregator_AggregationCompleted
        (
            object sender,
            RunWorkerCompletedEventArgs e
        )
        {
            AssertValid();

            EnableControls();

            if (e.Cancelled)
            {
            }
            else if (e.Error != null)
            {
                ErrorUtil.OnException(e.Error);
                slStatusLabel.Text = String.Empty;
            }
            else
            {
                // The final status message is a summary of what was done.  Show it
                // in a message box in addition to the StatusLabel.

                this.ShowInformation(slStatusLabel.Text);
                this.Close();
            }
        }
All Usage Examples Of Smrf.NodeXL.ExcelTemplate.ErrorUtil::OnException