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

GraphMetricCalculationManager_GraphMetricCalculationProgressChanged() private method

private GraphMetricCalculationManager_GraphMetricCalculationProgressChanged ( object sender, ProgressChangedEventArgs e ) : void
sender object
e ProgressChangedEventArgs
return void
    GraphMetricCalculationManager_GraphMetricCalculationProgressChanged
    (
        object sender,
        ProgressChangedEventArgs e
    )
    {
        Debug.Assert(e.UserState is GraphMetricProgress);
        AssertValid();

        GraphMetricProgress oGraphMetricProgress =
            (GraphMetricProgress)e.UserState;

        lblStatus.Text = oGraphMetricProgress.ProgressMessage;
        pbProgress.Value = e.ProgressPercentage;

        if (oGraphMetricProgress.AllGraphMetricsCalculated)
        {
            // Writing to the workbook will occur shortly within the
            // GraphMetricCalculationCompleted handler.  Writing can't be
            // cancelled, so disable the cancel button.

            btnCancel.Enabled = false;
        }
    }