Smrf.NodeXL.ExcelTemplate.TaskPane.ShowReadabilityMetrics C# (CSharp) Method

ShowReadabilityMetrics() protected method

protected ShowReadabilityMetrics ( ) : void
return void
    ShowReadabilityMetrics()
    {
        AssertValid();

        if (oNodeXLControl.IsLayingOutGraph)
        {
            return;
        }

        if (m_oReadabilityMetricsDialog != null)
        {
            m_oReadabilityMetricsDialog.Activate();
            return;
        }

        if (!this.NonEmptyWorkbookRead)
        {
            FormUtil.ShowWarning(
                "Readability metrics can be calculated only after the graph"
                + " has been shown.  "
                + HowToShowGraphMessage
                );

            return;
        }

        // The dialog is created on demand.

        m_oReadabilityMetricsDialog =
            new ReadabilityMetricsDialog(oNodeXLControl, m_oWorkbook);

        Int32 iHwnd = m_oWorkbook.Application.Hwnd;

        m_oReadabilityMetricsDialog.Closed += delegate
        {
            // See the code in ThisWorkbook that opens the
            // AutoFillWorkbookDialog for an explanation of why the
            // SetForegroundWindow() call is necessary.

            Win32Functions.SetForegroundWindow( new IntPtr(iHwnd) );

            m_oReadabilityMetricsDialog = null;
        };

        m_oReadabilityMetricsDialog.Show( new Win32Window(iHwnd) );
    }
TaskPane