Exemple #1
0
        TryRemoveSelectedVerticesFromGroups
        (
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            Sheet2 oVertexWorksheet,
            out ICollection <String> oSelectedVertexNames
        )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oVertexWorksheet != null);

            oSelectedVertexNames = oVertexWorksheet.GetSelectedVertexNames();

            ExcelUtil.RemoveTableRowsByStringColumnValues(oWorkbook,
                                                          WorksheetNames.GroupVertices, TableNames.GroupVertices,
                                                          GroupVertexTableColumnNames.VertexName, oSelectedVertexNames);

            return(true);
        }
Exemple #2
0
        TrySelectGroupsWithSelectedVertices
        (
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            Sheet2 oVertexWorksheet,
            Sheet5 oGroupWorksheet
        )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oVertexWorksheet != null);
            Debug.Assert(oGroupWorksheet != null);

            // For each selected vertex, get the vertex's group name from the
            // group-vertex worksheet and select that group in the group worksheet.

            ICollection <String> oSelectedVertexNames =
                oVertexWorksheet.GetSelectedVertexNames();

            oGroupWorksheet.SelectGroups(
                NodeXLWorkbookUtil.GetGroupNamesByVertexName(oWorkbook,
                                                             oSelectedVertexNames));

            return(true);
        }
Exemple #3
0
        //*************************************************************************
        //  Method: TrySelectGroupsWithSelectedVertices()
        //
        /// <summary>
        /// Attempts to select the groups containing the selected vertices in the
        /// workbook.
        /// </summary>
        ///
        /// <param name="oWorkbook">
        /// NodeXL workbook.
        /// </param>
        ///
        /// <param name="oVertexWorksheet">
        /// The vertex worksheet in the NodeXL workbook.
        /// </param>
        ///
        /// <param name="oGroupWorksheet">
        /// The group worksheet in the NodeXL workbook.
        /// </param>
        ///
        /// <returns>
        /// true if successful.
        /// </returns>
        ///
        /// <remarks>
        /// This method activates the group worksheet.
        /// </remarks>
        //*************************************************************************
        private static Boolean TrySelectGroupsWithSelectedVertices(
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            Sheet2 oVertexWorksheet,
            Sheet5 oGroupWorksheet
            )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oVertexWorksheet != null);
            Debug.Assert(oGroupWorksheet != null);

            // For each selected vertex, get the vertex's group name from the
            // group-vertex worksheet and select that group in the group worksheet.

            ICollection<String> oSelectedVertexNames =
            oVertexWorksheet.GetSelectedVertexNames();

            oGroupWorksheet.SelectGroups(
            NodeXLWorkbookUtil.GetGroupNamesByVertexName(oWorkbook,
                oSelectedVertexNames) );

            return (true);
        }
Exemple #4
0
        //*************************************************************************
        //  Method: TryRemoveSelectedVerticesFromGroups()
        //
        /// <summary>
        /// Attempts to remove the selected vertices from their groups in the
        /// workbook.
        /// </summary>
        ///
        /// <param name="oWorkbook">
        /// NodeXL workbook.
        /// </param>
        ///
        /// <param name="oVertexWorksheet">
        /// The vertex worksheet in the NodeXL workbook.
        /// </param>
        ///
        /// <param name="oSelectedVertexNames">
        /// Where a collection of the selected vertex names gets stored if true is
        /// returned.
        /// </param>
        ///
        /// <returns>
        /// true if successful.
        /// </returns>
        //*************************************************************************
        private static Boolean TryRemoveSelectedVerticesFromGroups(
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            Sheet2 oVertexWorksheet,
            out ICollection<String> oSelectedVertexNames
            )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oVertexWorksheet != null);

            oSelectedVertexNames = oVertexWorksheet.GetSelectedVertexNames();

            ExcelUtil.RemoveTableRowsByStringColumnValues(oWorkbook,
            WorksheetNames.GroupVertices, TableNames.GroupVertices,
            GroupVertexTableColumnNames.VertexName, oSelectedVertexNames);

            return (true);
        }