Represents a ComboBox that lets the user select a column from the edge table.
Call ColumnComboBox.PopulateWithTableColumnNames to populate the ComboBox with the edge table column names.
Inheritance: ColumnComboBox
コード例 #1
0
    InitializeEdgeComboBoxes
    (
        Microsoft.Office.Interop.Excel.Workbook oWorkbook
    )
    {
        Debug.Assert(oWorkbook != null);

        m_aoEdgeSourceColumnNameComboBoxes =
            new EdgeColumnComboBox[]
            {
                cbxEdgeColorSourceColumnName,
                cbxEdgeWidthSourceColumnName,
                cbxEdgeStyleSourceColumnName,
                cbxEdgeAlphaSourceColumnName,
                cbxEdgeVisibilitySourceColumnName,
                cbxEdgeLabelSourceColumnName,
            };

        ListObject oEdgeTable;

        if ( ExcelTableUtil.TryGetTable(oWorkbook, WorksheetNames.Edges,
            TableNames.Edges, out oEdgeTable) )
        {
            // Populate the edge table column ComboBoxes with the source column
            // names.

            foreach (EdgeColumnComboBox oComboBox in
                m_aoEdgeSourceColumnNameComboBoxes)
            {
                oComboBox.PopulateWithTableColumnNames(oEdgeTable);
            }
        }

        // Store the name of the column corresponding to the ComboBox in each
        // ComboBox's Tag.  This gets used for error checking by
        // DoDataExchange().

        cbxEdgeColorSourceColumnName.Tag = EdgeTableColumnNames.Color;
        cbxEdgeWidthSourceColumnName.Tag = EdgeTableColumnNames.Width;
        cbxEdgeStyleSourceColumnName.Tag = EdgeTableColumnNames.Style;
        cbxEdgeAlphaSourceColumnName.Tag = CommonTableColumnNames.Alpha;

        cbxEdgeVisibilitySourceColumnName.Tag =
            CommonTableColumnNames.Visibility;

        cbxEdgeLabelSourceColumnName.Tag = EdgeTableColumnNames.Label;
    }