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

WordMetricUserSettingsDialog() public method

Initializes a new instance of the class.
public WordMetricUserSettingsDialog ( WordMetricUserSettings wordMetricUserSettings, Microsoft workbook ) : System
wordMetricUserSettings WordMetricUserSettings /// The object being edited. ///
workbook Microsoft /// Workbook containing the graph contents. ///
return System
    public WordMetricUserSettingsDialog
    (
        WordMetricUserSettings wordMetricUserSettings,
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    {
        Debug.Assert(wordMetricUserSettings != null);
        Debug.Assert(workbook != null);

        m_oWordMetricUserSettings = wordMetricUserSettings;

        InitializeComponent();

        // Populate the column name ComboBoxes with column names from the
        // workbook.

        ListObject oTable;

        if ( ExcelTableUtil.TryGetTable(workbook, WorksheetNames.Edges,
            TableNames.Edges, out oTable) )
        {
            cbxEdgeColumnName.PopulateWithTableColumnNames(oTable);
        }

        if ( ExcelTableUtil.TryGetTable(workbook, WorksheetNames.Vertices,
            TableNames.Vertices, out oTable) )
        {
            cbxVertexColumnName.PopulateWithTableColumnNames(oTable);
        }

        // 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_oWordMetricUserSettingsDialogUserSettings =
            new WordMetricUserSettingsDialogUserSettings(this);

        DoDataExchange(false);

        AssertValid();
    }