Smrf.NodeXL.ExcelTemplate.CalculateGraphMetricsDialog.GraphMetricCalculationManager_GraphMetricCalculationCompleted C# (CSharp) Method

GraphMetricCalculationManager_GraphMetricCalculationCompleted() private method

private GraphMetricCalculationManager_GraphMetricCalculationCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void
sender object
e RunWorkerCompletedEventArgs
return void
    GraphMetricCalculationManager_GraphMetricCalculationCompleted
    (
        object sender,
        RunWorkerCompletedEventArgs e
    )
    {
        AssertValid();

        Exception oException = e.Error;

        if (oException != null)
        {
            if (oException is GraphMetricException)
            {
                // This is a known exception.

                this.ShowWarning(oException.Message);
            }
            else
            {
                // The exception is unexpected.

                ErrorUtil.OnException(oException);
            }
        }
        else if (!e.Cancelled)
        {
            Debug.Assert( e.Result is GraphMetricColumn[] );

            WriteGraphMetricColumnsToWorkbook(
                ( GraphMetricColumn[] )e.Result );

            // Everything succeeded.

            this.DialogResult = DialogResult.OK;
        }

        this.Close();
    }