Smrf.NodeXL.ExcelTemplate.AggregateGraphMetricsDialog.OnClosed C# (CSharp) Method

OnClosed() protected method

protected OnClosed ( EventArgs e ) : void
e System.EventArgs
return void
    OnClosed
    (
        EventArgs e
    )
    {
        AssertValid();

        if (m_oGraphMetricsAggregator.IsBusy)
        {
            // Let the background thread cancel its task, but don't try to
            // notify this dialog.

            m_oGraphMetricsAggregator.AggregationProgressChanged -=
                new ProgressChangedEventHandler(
                    GraphMetricsAggregator_AggregationProgressChanged);

            m_oGraphMetricsAggregator.AggregationCompleted -=
                new RunWorkerCompletedEventHandler(
                    GraphMetricsAggregator_AggregationCompleted);

            m_oGraphMetricsAggregator.CancelAsync();
        }
    }