Beispiel #1
0
        SelectGroupTableRows()
        {
            AssertValid();

            SheetHelper oSheetHelper = m_oGroupWorksheet.SheetHelper;

            if (!oSheetHelper.TableExists)
            {
                return;
            }

            m_bIgnoreSelectionEvents = true;

            try
            {
                oSheetHelper.SelectTableRowsByColumnValues <String>(
                    GroupTableColumnNames.Name,
                    m_oTaskPane.GetSelectedCollapsedGroupNames(),
                    ExcelUtil.TryGetNonEmptyStringFromCell
                    );
            }
            catch (Exception oException)
            {
                ErrorUtil.OnException(oException);
            }
            finally
            {
                m_bIgnoreSelectionEvents = false;
            }
        }
Beispiel #2
0
        Sheet5_Startup
        (
            object sender,
            System.EventArgs e
        )
        {
            Globals.ThisWorkbook.SetVisualAttribute2 +=
                new SetVisualAttributeEventHandler(
                    this.ThisWorkbook_SetVisualAttribute2);

            // Create the helper object.

            m_oSheetHelper = new SheetHelper(this, this.Groups);
        }
Beispiel #3
0
        IgnoreTableSelectionChange
        (
            SheetHelper oSheetHelper
        )
        {
            Debug.Assert(oSheetHelper != null);
            AssertValid();

            return(
                // Work around an Excel bug.  See the
                // ExcelUtil.SpecialCellsBeingCalled property for details.

                ExcelUtil.SpecialCellsBeingCalled
                ||
                m_bIgnoreSelectionEvents

                ||
                !oSheetHelper.TableExists
                );
        }
Beispiel #4
0
        OnGroupTableSelectionChange()
        {
            AssertValid();

            SheetHelper oSheetHelper = m_oGroupWorksheet.SheetHelper;

            if (IgnoreTableSelectionChange(oSheetHelper))
            {
                return;
            }

            // Enable the "set visual attribute" buttons in the Ribbon.

            m_oThisWorkbook.EnableSetVisualAttributes();

            LinkedList <Int32> oVertexRowIDsToSelect = new LinkedList <Int32>();

            LinkedList <String> oCollapsedGroupNamesToSelect =
                new LinkedList <String>();

            foreach (String sSelectedGroupName in
                     oSheetHelper.GetSelectedStringColumnValues(
                         GroupTableColumnNames.Name))
            {
                if (m_oTaskPane.IsCollapsedGroup(sSelectedGroupName))
                {
                    oCollapsedGroupNamesToSelect.AddLast(sSelectedGroupName);
                }
                else
                {
                    foreach (Int32 iVertexIDInGroup in
                             NodeXLWorkbookUtil.GetVertexIDsInGroup(
                                 m_oThisWorkbook.InnerObject, sSelectedGroupName))
                    {
                        oVertexRowIDsToSelect.AddLast(iVertexIDInGroup);
                    }
                }
            }

            m_bIgnoreSelectionEvents = true;

            // Select the vertices in the graph, then defer the selection of the
            // corresponding rows in the edge and vertex worksheets until those
            // worksheets are activated.

            m_oTaskPane.SetSelectedVerticesByRowID(oVertexRowIDsToSelect);

            m_bUpdateEdgeSelectionOnActivation   = true;
            m_bUpdateVertexSelectionOnActivation = true;

            // Select the vertices that represent collapsed groups.  This has to be
            // done after selecting the other vertices, because selecting the other
            // vertices clears the selection.

            foreach (String sCollapsedSelectedGroupName in
                     oCollapsedGroupNamesToSelect)
            {
                m_oTaskPane.SelectCollapsedGroup(sCollapsedSelectedGroupName);
            }

            m_bIgnoreSelectionEvents = false;
        }