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

OnLoad() protected method

protected OnLoad ( EventArgs e ) : void
e EventArgs
return void
    OnLoad
    (
        EventArgs e
    )
    {
        AssertValid();

        base.OnLoad(e);

        // Start the calculations.

        try
        {
            if (m_oGraphMetricCalculators != null)
            {
                // Use the specified graph metric calculators.

                m_oGraphMetricCalculationManager.CalculateGraphMetricsAsync(
                    m_oGraph, m_oWorkbook, m_oGraphMetricCalculators);
            }
            else
            {
                // Use a default list of graph metric calculators.

                m_oGraphMetricCalculationManager.CalculateGraphMetricsAsync(
                    m_oGraph, m_oWorkbook);
            }
        }
        catch (Exception oException)
        {
            // An exception was thrown from the synchronous code within
            // CalculateGraphMetricsAsync().  (Exceptions thrown from the
            // asynchronous code are handled by the
            // GraphMetricCalculationCompleted event handler.)

            ErrorUtil.OnException(oException);

            this.Close();
        }
    }