AddColumnPair() публичный Метод

public AddColumnPair ( Microsoft workbook, String worksheetName, String tableName, String column1NameBase, Double column1WidthChars, String column2NameBase, Double column2WidthChars ) : void
workbook Microsoft
worksheetName String
tableName String
column1NameBase String
column1WidthChars Double
column2NameBase String
column2WidthChars Double
Результат void
    btnCustomizeVertexMenu_Click
    (
        object sender,
        EventArgs e
    )
    {
        AssertValid();

        const String Message =
            "Use this to add custom menu items to the menu that appears when"
            + " you right-click a vertex in the graph pane."
            + "\r\n\r\n"
            + "Clicking \"Yes\" below will add a pair of columns to the"
            + " Vertices worksheet -- one for menu item text and another for"
            + " the action to take when the menu item is selected."
            + "\r\n\r\n"
            + "For example, if you add the column pair and enter \"Send Mail"
            + " To\" for a vertex's menu item text and \"mailto:[email protected]\""
            + " for the action, then right-clicking the vertex in the NodeXL"
            + " graph and selecting \"Send Mail To\" from the right-click menu"
            + " will open a new email message addressed to [email protected]."
            + "\r\n\r\n"
            + "If you want to open a Web page when the menu item is selected,"
            + " enter an URL for the action."
            + "\r\n\r\n"
            + "If you want to add more than one custom menu item to a vertex's"
            + " right-click menu, run this again to add another pair of"
            + " columns."
            + "\r\n\r\n"
            + "Do you want to add a pair of columns to the Vertices worksheet?"
            ;

        if (MessageBox.Show(Message, this.ApplicationName,
                MessageBoxButtons.YesNo, MessageBoxIcon.Information) !=
                DialogResult.Yes)
        {
            return;
        }

        // Create and use the object that adds the columns to the vertex
        // table.

        TableColumnAdder oTableColumnAdder = new TableColumnAdder();

        this.UseWaitCursor = true;

        try
        {
            oTableColumnAdder.AddColumnPair(m_oWorkbook,
                WorksheetNames.Vertices, TableNames.Vertices,
                VertexTableColumnNames.CustomMenuItemTextBase,
                CustomMenuItemTextColumnWidth,
                VertexTableColumnNames.CustomMenuItemActionBase,
                CustomMenuItemActionColumnWidth
                );

            this.UseWaitCursor = false;
        }
        catch (Exception oException)
        {
            this.UseWaitCursor = false;

            ErrorUtil.OnException(oException);
        }
    }
Пример #2
0
        btnCustomizeVertexMenu_Click
        (
            object sender,
            EventArgs e
        )
        {
            AssertValid();

            const String Message =
                "Use this to add custom menu items to the menu that appears when"
                + " you right-click a vertex in the graph pane."
                + "\r\n\r\n"
                + "Clicking \"Yes\" below will add a pair of columns to the"
                + " Vertices worksheet -- one for menu item text and another for"
                + " the action to take when the menu item is selected."
                + "\r\n\r\n"
                + "For example, if you add the column pair and enter \"Send Mail"
                + " To\" for a vertex's menu item text and \"mailto:[email protected]\""
                + " for the action, then right-clicking the vertex in the NodeXL"
                + " graph and selecting \"Send Mail To\" from the right-click menu"
                + " will open a new email message addressed to [email protected]."
                + "\r\n\r\n"
                + "If you want to open a Web page when the menu item is selected,"
                + " enter an URL for the action."
                + "\r\n\r\n"
                + "If you want to add more than one custom menu item to a vertex's"
                + " right-click menu, run this again to add another pair of"
                + " columns."
                + "\r\n\r\n"
                + "Do you want to add a pair of columns to the Vertices worksheet?"
            ;

            if (MessageBox.Show(Message, this.ApplicationName,
                                MessageBoxButtons.YesNo, MessageBoxIcon.Information) !=
                DialogResult.Yes)
            {
                return;
            }

            // Create and use the object that adds the columns to the vertex
            // table.

            TableColumnAdder oTableColumnAdder = new TableColumnAdder();

            this.UseWaitCursor = true;

            try
            {
                oTableColumnAdder.AddColumnPair(m_oWorkbook,
                                                WorksheetNames.Vertices, TableNames.Vertices,
                                                VertexTableColumnNames.CustomMenuItemTextBase,
                                                CustomMenuItemTextColumnWidth,
                                                VertexTableColumnNames.CustomMenuItemActionBase,
                                                CustomMenuItemActionColumnWidth
                                                );

                this.UseWaitCursor = false;
            }
            catch (Exception oException)
            {
                this.UseWaitCursor = false;

                ErrorUtil.OnException(oException);
            }
        }