Smrf.NodeXL.ExcelTemplate.GraphMetricsDialog.GraphMetricsDialog C# (CSharp) Method

GraphMetricsDialog() public method

Initializes a new instance of the GraphMetricsDialog class.
public GraphMetricsDialog ( DialogMode mode, Microsoft workbook ) : System
mode DialogMode /// Indicates the mode in which the dialog is being used. ///
workbook Microsoft /// Workbook containing the graph contents. ///
return System
    public GraphMetricsDialog
    (
        DialogMode mode,
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    {
        InitializeComponent();

        m_eMode = mode;
        m_oWorkbook = workbook;
        m_oGraphMetricUserSettings = new GraphMetricUserSettings();

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

        m_oGraphMetricsDialogUserSettings =
            new GraphMetricsDialogUserSettings(this);

        if (m_eMode == DialogMode.EditOnly)
        {
            this.Text += " Options";
            btnOK.Text = "OK";
        }

        clbGraphMetrics.Items.AddRange(
            GraphMetricInformation.GetAllGraphMetricInformation() );

        clbGraphMetrics.SetSelected(0, true);

        DoDataExchange(false);

        AssertValid();
    }