示例#1
0
        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
        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);
            }
        }
        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();
                }
            }
        }