Inheritance: NodeXLApplicationSettingsBase
    //*************************************************************************
    //  Constructor: DynamicFilterDialog()
    //
    /// <overloads>
    /// Initializes a new instance of the <see
    /// cref="DynamicFilterDialog" /> class.
    /// </overloads>
    ///
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="DynamicFilterDialog" /> class with a workbook.
    /// </summary>
    ///
    /// <param name="workbook">
    /// Workbook containing the graph contents.
    /// </param>
    //*************************************************************************

    public DynamicFilterDialog
    (
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    : this()
    {
        Debug.Assert(workbook != null);

        // Instantiate an object that saves and retrieves the user settings for
        // this dialog.  Note that the object automatically saves the settings
        // when the form closes.

        m_oDynamicFilterDialogUserSettings =
            new DynamicFilterDialogUserSettings(this);

        m_oWorkbook = workbook;

        m_oExcelCalculationRestorer =
            new ExcelCalculationRestorer(workbook.Application);

        m_oExcelCalculationRestorer.TimerIntervalMs =
            CalculationRestorerTimerIntervalMs;

        m_bHandleControlEvents = false;

        m_oChangeEventDelayTimer = new Timer();
        m_oChangeEventDelayTimer.Interval = ChangeEventTimerIntervalMs;

        m_oChangeEventDelayTimer.Tick += new EventHandler(
            this.m_oChangeEventDelayTimer_Tick);

        m_oDynamicFilterSettings = null;
        m_oEdgeDynamicFilterColumnData = null;
        m_oVertexDynamicFilterColumnData = null;

        DynamicFiltersUserSettings oDynamicFiltersUserSettings =
            new DynamicFiltersUserSettings();

        chkDoNotFilterNonNumericCells.Checked = 
            !oDynamicFiltersUserSettings.FilterNonNumericCells;

        nudFilteredAlpha.Minimum =
            (Decimal)AlphaConverter.MinimumAlphaWorkbook;

        nudFilteredAlpha.Maximum =
            (Decimal)AlphaConverter.MaximumAlphaWorkbook;

        nudFilteredAlpha.Value = (Decimal)
            oDynamicFiltersUserSettings.FilteredAlpha;

        AssertValid();
    }
    OnClosed
    (
        EventArgs e
    )
    {
        AssertValid();

        base.OnClosed(e);

        if (m_oChangeEventDelayTimer != null)
        {
            m_oChangeEventDelayTimer.Stop();
        }

        // Immediately restore the original value of the
        // Application.Calculation property.

        m_oExcelCalculationRestorer.Restore();

        DynamicFiltersUserSettings oDynamicFiltersUserSettings =
            new DynamicFiltersUserSettings();

        oDynamicFiltersUserSettings.FilterNonNumericCells =
            !chkDoNotFilterNonNumericCells.Checked;

        oDynamicFiltersUserSettings.FilteredAlpha =
            (Single)nudFilteredAlpha.Value;

        oDynamicFiltersUserSettings.Save();
    }