コード例 #1
0
ファイル: NodeXLWorkbookUtil.cs プロジェクト: yesbb12/NetMap
        ClearAllNodeXLTables
        (
            Microsoft.Office.Interop.Excel.Workbook workbook
        )
        {
            Debug.Assert(workbook != null);

            TableImagePopulator.DeleteImagesInColumn(workbook,
                                                     WorksheetNames.Vertices, VertexTableColumnNames.SubgraphImage);

            ExcelUtil.ClearTables(workbook,
                                  WorksheetNames.Edges, TableNames.Edges,
                                  WorksheetNames.Vertices, TableNames.Vertices,
                                  WorksheetNames.OverallMetrics, TableNames.OverallMetrics,
                                  WorksheetNames.Miscellaneous, TableNames.DynamicFilterSettings
                                  );

            ClearGroupTables(workbook);

            (new PerWorkbookSettings(workbook)).OnWorkbookTablesCleared();
        }
コード例 #2
0
ファイル: ColumnGroupManager.cs プロジェクト: yesbb12/NetMap
        ShowOrHideColumnGroup
        (
            Microsoft.Office.Interop.Excel.Workbook workbook,
            ColumnGroup columnGroup,
            Boolean show,
            Boolean activateWorksheet
        )
        {
            Debug.Assert(workbook != null);

            ListObject oTable;

            if (TryGetColumnGroupTable(workbook, columnGroup, out oTable))
            {
                ExcelColumnHider.ShowOrHideColumns(oTable,
                                                   GetColumnNames(workbook, columnGroup), show);

                if (columnGroup == ColumnGroup.VertexOtherColumns)
                {
                    // Hiding the subgraph image column doesn't hide the images in
                    // the column.

                    TableImagePopulator.ShowOrHideImagesInColumn(workbook,
                                                                 WorksheetNames.Vertices,
                                                                 VertexTableColumnNames.SubgraphImage, show);
                }

                if (activateWorksheet)
                {
                    ExcelUtil.ActivateWorksheet(oTable);
                }

                (new PerWorkbookSettings(workbook)).SetColumnGroupVisibility(
                    columnGroup, show);
            }
        }
コード例 #3
0
        OnImageCreationCompleted
        (
            RunWorkerCompletedEventArgs e
        )
        {
            AssertValid();

            if (e.Cancelled)
            {
                this.State = DialogState.Idle;

                lblStatus.Text = "Image creation stopped.";
            }
            else if (e.Error != null)
            {
                this.State = DialogState.Idle;

                Exception oException = e.Error;

                if (oException is System.IO.IOException)
                {
                    lblStatus.Text = "Image creation error.";

                    this.ShowWarning(oException.Message);
                }
                else
                {
                    ErrorUtil.OnException(oException);
                }
            }
            else
            {
                // Success.  Were temporary images created that need to be inserted
                // into the vertex worksheet?

                Debug.Assert(e.Result is TemporaryImages);

                TemporaryImages oTemporaryImages = (TemporaryImages)e.Result;

                if (oTemporaryImages.Folder != null)
                {
                    // Yes.  Insert them, then delete the temporary images.

                    this.State = DialogState.PopulatingImageColumn;

                    String sLastStatusFromSubgraphImageCreator = lblStatus.Text;

                    lblStatus.Text =
                        "Inserting subgraph thumbnails into the worksheet.  Please"
                        + " wait...";

                    TableImagePopulator.PopulateColumnWithImages(m_oWorkbook,
                                                                 WorksheetNames.Vertices, TableNames.Vertices,
                                                                 VertexTableColumnNames.SubgraphImage,
                                                                 VertexTableColumnNames.VertexName, oTemporaryImages
                                                                 );

                    lblStatus.Text = sLastStatusFromSubgraphImageCreator;
                }

                this.State = DialogState.Idle;

                if (m_eMode == DialogMode.Automate)
                {
                    this.Close();
                }
            }
        }