Stores the results of a call to .
If a caller of WorkbookAutoFiller.AutoFillWorkbook needs to know how the workbook was autofilled, it can't just look at the object it passes in. That's because one or more columns may be autofilled using the minimum or maximum column values, and the caller doesn't know those values. This class, which is returned by , provides the required information.

The object can be persisted to and from a string using and ConvertFromString.

Currently, only the results needed by and the graph axes are stored. This may be expanded in the future.

상속: Object
예제 #1
0
        AutoFillWorkbookInternal
        (
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            AutoFillUserSettings oAutoFillUserSettings
        )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oAutoFillUserSettings != null);

            // Populate the vertex worksheet with the name of each unique vertex in
            // the edge worksheet.

            (new VertexWorksheetPopulator()).PopulateVertexWorksheet(
                oWorkbook, false);

            AutoFillWorkbookResults oAutoFillWorkbookResults =
                new AutoFillWorkbookResults();

            AutoFillTable(oWorkbook, oAutoFillUserSettings,
                          oAutoFillWorkbookResults, WorksheetNames.Edges,
                          TableNames.Edges, AutoFillEdgeTable);

            AutoFillTable(oWorkbook, oAutoFillUserSettings,
                          oAutoFillWorkbookResults, WorksheetNames.Vertices,
                          TableNames.Vertices, AutoFillVertexTable);

            AutoFillTable(oWorkbook, oAutoFillUserSettings,
                          oAutoFillWorkbookResults, WorksheetNames.Groups,
                          TableNames.Groups, AutoFillGroupTable);

            // Save the results.

            (new PerWorkbookSettings(oWorkbook)).AutoFillWorkbookResults =
                oAutoFillWorkbookResults;
        }
예제 #2
0
        AutoFillGroupTable
        (
            ListObject oGroupTable,
            AutoFillUserSettings oAutoFillUserSettings,
            AutoFillWorkbookResults oAutoFillWorkbookResults
        )
        {
            Debug.Assert(oGroupTable != null);
            Debug.Assert(oAutoFillUserSettings != null);
            Debug.Assert(oAutoFillWorkbookResults != null);

            AutoFillNumericComparisonColumn(oGroupTable,
                                            oAutoFillUserSettings.GroupCollapsedSourceColumnName,
                                            GroupTableColumnNames.Collapsed,
                                            oAutoFillUserSettings.GroupCollapsedDetails
                                            );

            if (
                AutoFillColumnViaCopy(oGroupTable,
                                      oAutoFillUserSettings.GroupLabelSourceColumnName,
                                      GroupTableColumnNames.Label)
                &&
                oAutoFillUserSettings.GroupLabelDetails.PrependWithGroupName
                )
            {
                PrependGroupLabelsWithGroupNames(oGroupTable);
            }
        }
예제 #3
0
        btnClear_Click
        (
            object sender,
            System.EventArgs e
        )
        {
            AssertValid();

            m_oGraphHistory            = new GraphHistory();
            m_oAutoFillWorkbookResults = new AutoFillWorkbookResults();
            DoDataExchange(false);
        }
    //*************************************************************************
    //  Constructor: AutoFillResultsLegendControl()
    //
    /// <summary>
    /// Initializes a new instance of the <see
    /// cref="AutoFillResultsLegendControl" /> class.
    /// </summary>
    //*************************************************************************

    public AutoFillResultsLegendControl()
    {
        m_iLastResizeWidth = Int32.MinValue;

        // Start with an empty (but not null) object.

        m_oAutoFillWorkbookResults = new AutoFillWorkbookResults();

        this.DoubleBuffered = true;
        this.BackColor = SystemColors.Window;

        AssertValid();
    }
        Update
        (
            AutoFillWorkbookResults autoFillWorkbookResults
        )
        {
            Debug.Assert(autoFillWorkbookResults != null);
            AssertValid();

            m_oAutoFillWorkbookResults = autoFillWorkbookResults;

            this.Height = CalculateHeight();
            Invalidate();
        }
    Update
    (
        AutoFillWorkbookResults autoFillWorkbookResults
    )
    {
        Debug.Assert(autoFillWorkbookResults != null);
        AssertValid();

        m_oAutoFillWorkbookResults = autoFillWorkbookResults;

        this.Height = CalculateHeight();
        Invalidate();
    }
        //*************************************************************************
        //  Constructor: AutoFillResultsLegendControl()
        //
        /// <summary>
        /// Initializes a new instance of the <see
        /// cref="AutoFillResultsLegendControl" /> class.
        /// </summary>
        //*************************************************************************

        public AutoFillResultsLegendControl()
        {
            m_iLastResizeWidth = Int32.MinValue;

            // Start with an empty (but not null) object.

            m_oAutoFillWorkbookResults = new AutoFillWorkbookResults();

            this.DoubleBuffered = true;
            this.BackColor      = SystemColors.Window;

            AssertValid();
        }
        FromString
        (
            String theString
        )
        {
            Debug.Assert(!String.IsNullOrEmpty(theString));

            AutoFillWorkbookResults oAutoFillWorkbookResults =
                new AutoFillWorkbookResults();

            oAutoFillWorkbookResults.ConvertFromString(theString);

            return(oAutoFillWorkbookResults);
        }
예제 #9
0
        SummarizeGraphInternal
        (
            GraphHistory oGraphHistory,
            AutoFillWorkbookResults oAutoFillWorkbookResults,
            OverallMetrics oOverallMetrics,
            String oTopNByMetrics,
            String oTwitterSearchNetworkTopItems
        )
        {
            Debug.Assert(oGraphHistory != null);
            Debug.Assert(oAutoFillWorkbookResults != null);

            StringBuilder oStringBuilder = new StringBuilder();

            AppendGraphHistoryValues(oGraphHistory, oStringBuilder,
                                     GraphHistoryKeys.ImportDescription,
                                     GraphHistoryKeys.GraphDirectedness,
                                     GraphHistoryKeys.GroupingDescription,
                                     GraphHistoryKeys.LayoutAlgorithm
                                     );

            StringUtil.AppendLineAfterEmptyLine(oStringBuilder,
                                                oAutoFillWorkbookResults.ConvertToSummaryString());

            if (oOverallMetrics != null)
            {
                StringUtil.AppendLineAfterEmptyLine(oStringBuilder,
                                                    "Overall Graph Metrics:");

                oStringBuilder.AppendLine(
                    oOverallMetrics.ConvertToSummaryString());
            }

            StringUtil.AppendLineAfterEmptyLine(oStringBuilder, oTopNByMetrics);

            StringUtil.AppendLineAfterEmptyLine(oStringBuilder,
                                                oTwitterSearchNetworkTopItems);

            AppendGraphHistoryValues(oGraphHistory, oStringBuilder,
                                     GraphHistoryKeys.Comments
                                     );

            return(oStringBuilder.ToString());
        }
예제 #10
0
        TrySummarizeGraph
        (
            GraphHistory graphHistory,
            AutoFillWorkbookResults autoFillWorkbookResults,
            OverallMetrics overallMetrics,
            String topNByMetrics,
            String twitterSearchNetworkTopItems,
            out String graphSummary
        )
        {
            Debug.Assert(graphHistory != null);
            Debug.Assert(autoFillWorkbookResults != null);

            graphSummary = SummarizeGraphInternal(graphHistory,
                                                  autoFillWorkbookResults, overallMetrics, topNByMetrics,
                                                  twitterSearchNetworkTopItems);

            return(graphSummary.Length > 0);
        }
예제 #11
0
        AutoFillTable
        (
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            AutoFillUserSettings oAutoFillUserSettings,
            AutoFillWorkbookResults oAutoFillWorkbookResults,
            String sWorksheetName,
            String sTableName,
            AutoFillTableMethod oAutoFillTableMethod
        )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oAutoFillUserSettings != null);
            Debug.Assert(oAutoFillWorkbookResults != null);
            Debug.Assert(!String.IsNullOrEmpty(sWorksheetName));
            Debug.Assert(!String.IsNullOrEmpty(sTableName));
            Debug.Assert(oAutoFillTableMethod != null);

            ListObject         oTable;
            ExcelHiddenColumns oHiddenColumns;

            if (ExcelTableUtil.TryGetTable(oWorkbook, sWorksheetName, sTableName,
                                           out oTable))
            {
                // The TableColumnMapper class that does the actual autofilling
                // fills only visible cells.  Temporarily show all hidden columns
                // in the table.

                oHiddenColumns = ExcelColumnHider.ShowHiddenColumns(oTable);

                try
                {
                    oAutoFillTableMethod(oTable, oAutoFillUserSettings,
                                         oAutoFillWorkbookResults);
                }
                finally
                {
                    ExcelColumnHider.RestoreHiddenColumns(oTable, oHiddenColumns);
                }
            }
        }
    AutoFillWorkbookInternal
    (
        Microsoft.Office.Interop.Excel.Workbook oWorkbook,
        AutoFillUserSettings oAutoFillUserSettings
    )
    {
        Debug.Assert(oWorkbook != null);
        Debug.Assert(oAutoFillUserSettings != null);

        // Populate the vertex worksheet with the name of each unique vertex in
        // the edge worksheet.

        ( new VertexWorksheetPopulator() ).PopulateVertexWorksheet(
            oWorkbook, false);

        AutoFillWorkbookResults oAutoFillWorkbookResults =
            new AutoFillWorkbookResults();

        AutoFillTable(oWorkbook, oAutoFillUserSettings,
            oAutoFillWorkbookResults, WorksheetNames.Edges,
            TableNames.Edges, AutoFillEdgeTable);

        AutoFillTable(oWorkbook, oAutoFillUserSettings,
            oAutoFillWorkbookResults, WorksheetNames.Vertices,
            TableNames.Vertices, AutoFillVertexTable);

        AutoFillTable(oWorkbook, oAutoFillUserSettings,
            oAutoFillWorkbookResults, WorksheetNames.Groups,
            TableNames.Groups, AutoFillGroupTable);

        // Save the results.

        ( new PerWorkbookSettings(oWorkbook) ).AutoFillWorkbookResults =
            oAutoFillWorkbookResults;
    }
예제 #13
0
        AutoFillVertexTable
        (
            ListObject oVertexTable,
            AutoFillUserSettings oAutoFillUserSettings,
            AutoFillWorkbookResults oAutoFillWorkbookResults
        )
        {
            Debug.Assert(oVertexTable != null);
            Debug.Assert(oAutoFillUserSettings != null);
            Debug.Assert(oAutoFillWorkbookResults != null);

            Boolean bSourceColumnContainsNumbers;
            Double  dSourceCalculationNumber1, dSourceCalculationNumber2;
            Int32   iDecimalPlaces;
            ICollection <String> oCategoryNames;

            if (TryAutoFillColorColumn(oVertexTable,
                                       oAutoFillUserSettings.VertexColorSourceColumnName,
                                       VertexTableColumnNames.Color,
                                       oAutoFillUserSettings.VertexColorDetails,
                                       out bSourceColumnContainsNumbers,
                                       out dSourceCalculationNumber1,
                                       out dSourceCalculationNumber2,
                                       out iDecimalPlaces, out oCategoryNames
                                       ))
            {
                oAutoFillWorkbookResults.VertexColorResults =
                    new AutoFillColorColumnResults(
                        bSourceColumnContainsNumbers,
                        oAutoFillUserSettings.VertexColorSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.VertexColorDetails.DestinationColor1,
                        oAutoFillUserSettings.VertexColorDetails.DestinationColor2,
                        oCategoryNames
                        );
            }

            AutoFillNumericComparisonColumn(oVertexTable,
                                            oAutoFillUserSettings.VertexShapeSourceColumnName,
                                            VertexTableColumnNames.Shape,
                                            oAutoFillUserSettings.VertexShapeDetails
                                            );

            if (TryAutoFillNumericRangeColumn(oVertexTable,
                                              oAutoFillUserSettings.VertexRadiusSourceColumnName,
                                              VertexTableColumnNames.Radius,
                                              oAutoFillUserSettings.VertexRadiusDetails,
                                              out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                              out iDecimalPlaces
                                              ))
            {
                oAutoFillWorkbookResults.VertexRadiusResults =
                    new AutoFillNumericRangeColumnResults(
                        oAutoFillUserSettings.VertexRadiusSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.VertexRadiusDetails.
                        DestinationNumber1,
                        oAutoFillUserSettings.VertexRadiusDetails.
                        DestinationNumber2,
                        oAutoFillUserSettings.VertexRadiusDetails.UseLogs
                        );
            }

            if (TryAutoFillNumericRangeColumn(oVertexTable,
                                              oAutoFillUserSettings.VertexAlphaSourceColumnName,
                                              CommonTableColumnNames.Alpha,
                                              oAutoFillUserSettings.VertexAlphaDetails,
                                              out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                              out iDecimalPlaces
                                              ))
            {
                oAutoFillWorkbookResults.VertexAlphaResults =
                    new AutoFillNumericRangeColumnResults(
                        oAutoFillUserSettings.VertexAlphaSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.VertexAlphaDetails.DestinationNumber1,
                        oAutoFillUserSettings.VertexAlphaDetails.DestinationNumber2,
                        oAutoFillUserSettings.VertexAlphaDetails.UseLogs
                        );
            }

            AutoFillColumnViaCopy(oVertexTable,
                                  oAutoFillUserSettings.VertexLabelSourceColumnName,
                                  VertexTableColumnNames.Label
                                  );

            TryAutoFillColorColumn(oVertexTable,
                                   oAutoFillUserSettings.VertexLabelFillColorSourceColumnName,
                                   VertexTableColumnNames.LabelFillColor,
                                   oAutoFillUserSettings.VertexLabelFillColorDetails,
                                   out bSourceColumnContainsNumbers,
                                   out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                   out iDecimalPlaces, out oCategoryNames
                                   );

            AutoFillNumericComparisonColumn(oVertexTable,
                                            oAutoFillUserSettings.VertexLabelPositionSourceColumnName,
                                            VertexTableColumnNames.LabelPosition,
                                            oAutoFillUserSettings.VertexLabelPositionDetails
                                            );

            AutoFillColumnViaCopy(oVertexTable,
                                  oAutoFillUserSettings.VertexToolTipSourceColumnName,
                                  VertexTableColumnNames.ToolTip
                                  );

            AutoFillNumericComparisonColumn(oVertexTable,
                                            oAutoFillUserSettings.VertexVisibilitySourceColumnName,
                                            CommonTableColumnNames.Visibility,
                                            oAutoFillUserSettings.VertexVisibilityDetails
                                            );

            TryAutoFillNumericRangeColumn(oVertexTable,
                                          oAutoFillUserSettings.VertexLayoutOrderSourceColumnName,
                                          VertexTableColumnNames.LayoutOrder,
                                          oAutoFillUserSettings.VertexLayoutOrderDetails,
                                          out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                          out iDecimalPlaces
                                          );

            Boolean bXAutoFilled = TryAutoFillNumericRangeColumn(oVertexTable,
                                                                 oAutoFillUserSettings.VertexXSourceColumnName,
                                                                 VertexTableColumnNames.X,
                                                                 oAutoFillUserSettings.VertexXDetails,
                                                                 out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                                                 out iDecimalPlaces
                                                                 );

            Double dYSourceCalculationNumber1, dYSourceCalculationNumber2;

            Boolean bYAutoFilled = TryAutoFillNumericRangeColumn(oVertexTable,
                                                                 oAutoFillUserSettings.VertexYSourceColumnName,
                                                                 VertexTableColumnNames.Y,
                                                                 oAutoFillUserSettings.VertexYDetails,
                                                                 out dYSourceCalculationNumber1, out dYSourceCalculationNumber2,
                                                                 out iDecimalPlaces
                                                                 );

            if (bXAutoFilled && bYAutoFilled)
            {
                // (Note that the decimal places for the Y column take precedence
                // here.)

                oAutoFillWorkbookResults.VertexXResults =
                    new AutoFillNumericRangeColumnResults(
                        oAutoFillUserSettings.VertexXSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.VertexXDetails.DestinationNumber1,
                        oAutoFillUserSettings.VertexXDetails.DestinationNumber2,
                        oAutoFillUserSettings.VertexXDetails.UseLogs
                        );

                oAutoFillWorkbookResults.VertexYResults =
                    new AutoFillNumericRangeColumnResults(
                        oAutoFillUserSettings.VertexYSourceColumnName,
                        dYSourceCalculationNumber1, dYSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.VertexYDetails.DestinationNumber1,
                        oAutoFillUserSettings.VertexYDetails.DestinationNumber2,
                        oAutoFillUserSettings.VertexYDetails.UseLogs
                        );
            }

            TryAutoFillNumericRangeColumn(oVertexTable,
                                          oAutoFillUserSettings.VertexPolarRSourceColumnName,
                                          VertexTableColumnNames.PolarR,
                                          oAutoFillUserSettings.VertexPolarRDetails,
                                          out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                          out iDecimalPlaces
                                          );

            TryAutoFillNumericRangeColumn(oVertexTable,
                                          oAutoFillUserSettings.VertexPolarAngleSourceColumnName,
                                          VertexTableColumnNames.PolarAngle,
                                          oAutoFillUserSettings.VertexPolarAngleDetails,
                                          out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                          out iDecimalPlaces
                                          );
        }
예제 #14
0
        AutoFillEdgeTable
        (
            ListObject oEdgeTable,
            AutoFillUserSettings oAutoFillUserSettings,
            AutoFillWorkbookResults oAutoFillWorkbookResults
        )
        {
            Debug.Assert(oEdgeTable != null);
            Debug.Assert(oAutoFillUserSettings != null);
            Debug.Assert(oAutoFillWorkbookResults != null);

            Boolean bSourceColumnContainsNumbers;
            Double  dSourceCalculationNumber1, dSourceCalculationNumber2;
            Int32   iDecimalPlaces;
            ICollection <String> oCategoryNames;

            if (TryAutoFillColorColumn(oEdgeTable,
                                       oAutoFillUserSettings.EdgeColorSourceColumnName,
                                       EdgeTableColumnNames.Color,
                                       oAutoFillUserSettings.EdgeColorDetails,
                                       out bSourceColumnContainsNumbers,
                                       out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                       out iDecimalPlaces, out oCategoryNames
                                       ))
            {
                oAutoFillWorkbookResults.EdgeColorResults =
                    new AutoFillColorColumnResults(
                        bSourceColumnContainsNumbers,
                        oAutoFillUserSettings.EdgeColorSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.EdgeColorDetails.DestinationColor1,
                        oAutoFillUserSettings.EdgeColorDetails.DestinationColor2,
                        oCategoryNames
                        );
            }

            if (TryAutoFillNumericRangeColumn(oEdgeTable,
                                              oAutoFillUserSettings.EdgeWidthSourceColumnName,
                                              EdgeTableColumnNames.Width,
                                              oAutoFillUserSettings.EdgeWidthDetails,
                                              out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                              out iDecimalPlaces
                                              ))
            {
                oAutoFillWorkbookResults.EdgeWidthResults =
                    new AutoFillNumericRangeColumnResults(
                        oAutoFillUserSettings.EdgeWidthSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.EdgeWidthDetails.DestinationNumber1,
                        oAutoFillUserSettings.EdgeWidthDetails.DestinationNumber2,
                        oAutoFillUserSettings.EdgeWidthDetails.UseLogs
                        );
            }

            AutoFillNumericComparisonColumn(oEdgeTable,
                                            oAutoFillUserSettings.EdgeStyleSourceColumnName,
                                            EdgeTableColumnNames.Style, oAutoFillUserSettings.EdgeStyleDetails
                                            );

            if (TryAutoFillNumericRangeColumn(oEdgeTable,
                                              oAutoFillUserSettings.EdgeAlphaSourceColumnName,
                                              CommonTableColumnNames.Alpha,
                                              oAutoFillUserSettings.EdgeAlphaDetails,
                                              out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                                              out iDecimalPlaces
                                              ))
            {
                oAutoFillWorkbookResults.EdgeAlphaResults =
                    new AutoFillNumericRangeColumnResults(
                        oAutoFillUserSettings.EdgeAlphaSourceColumnName,
                        dSourceCalculationNumber1, dSourceCalculationNumber2,
                        iDecimalPlaces,
                        oAutoFillUserSettings.EdgeAlphaDetails.DestinationNumber1,
                        oAutoFillUserSettings.EdgeAlphaDetails.DestinationNumber2,
                        oAutoFillUserSettings.EdgeAlphaDetails.UseLogs
                        );
            }

            AutoFillNumericComparisonColumn(oEdgeTable,
                                            oAutoFillUserSettings.EdgeVisibilitySourceColumnName,
                                            CommonTableColumnNames.Visibility,
                                            oAutoFillUserSettings.EdgeVisibilityDetails
                                            );

            AutoFillColumnViaCopy(oEdgeTable,
                                  oAutoFillUserSettings.EdgeLabelSourceColumnName,
                                  EdgeTableColumnNames.Label
                                  );
        }
    AutoFillVertexTable
    (
        ListObject oVertexTable,
        AutoFillUserSettings oAutoFillUserSettings,
        AutoFillWorkbookResults oAutoFillWorkbookResults
    )
    {
        Debug.Assert(oVertexTable != null);
        Debug.Assert(oAutoFillUserSettings != null);
        Debug.Assert(oAutoFillWorkbookResults != null);

        Boolean bSourceColumnContainsNumbers;
        Double dSourceCalculationNumber1, dSourceCalculationNumber2;
        Int32 iDecimalPlaces;
        ICollection<String> oCategoryNames;

        if ( TryAutoFillColorColumn(oVertexTable,
                oAutoFillUserSettings.VertexColorSourceColumnName,
                VertexTableColumnNames.Color,
                oAutoFillUserSettings.VertexColorDetails,
                out bSourceColumnContainsNumbers,
                out dSourceCalculationNumber1,
                out dSourceCalculationNumber2,
                out iDecimalPlaces, out oCategoryNames
                ) )
        {
            oAutoFillWorkbookResults.VertexColorResults =
                new AutoFillColorColumnResults(
                    bSourceColumnContainsNumbers,
                    oAutoFillUserSettings.VertexColorSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.VertexColorDetails.DestinationColor1,
                    oAutoFillUserSettings.VertexColorDetails.DestinationColor2,
                    oCategoryNames
                    );
        }

        AutoFillNumericComparisonColumn(oVertexTable,
            oAutoFillUserSettings.VertexShapeSourceColumnName,
            VertexTableColumnNames.Shape,
            oAutoFillUserSettings.VertexShapeDetails
            );

        if ( TryAutoFillNumericRangeColumn(oVertexTable,
                oAutoFillUserSettings.VertexRadiusSourceColumnName,
                VertexTableColumnNames.Radius,
                oAutoFillUserSettings.VertexRadiusDetails,
                out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                out iDecimalPlaces
                ) )
        {
            oAutoFillWorkbookResults.VertexRadiusResults =
                new AutoFillNumericRangeColumnResults(
                    oAutoFillUserSettings.VertexRadiusSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.VertexRadiusDetails.
                        DestinationNumber1,
                    oAutoFillUserSettings.VertexRadiusDetails.
                        DestinationNumber2,
                    oAutoFillUserSettings.VertexRadiusDetails.UseLogs
                    );
        }

        if ( TryAutoFillNumericRangeColumn(oVertexTable,
                oAutoFillUserSettings.VertexAlphaSourceColumnName,
                CommonTableColumnNames.Alpha,
                oAutoFillUserSettings.VertexAlphaDetails,
                out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                out iDecimalPlaces
                ) )
        {
            oAutoFillWorkbookResults.VertexAlphaResults =
                new AutoFillNumericRangeColumnResults(
                    oAutoFillUserSettings.VertexAlphaSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.VertexAlphaDetails.DestinationNumber1,
                    oAutoFillUserSettings.VertexAlphaDetails.DestinationNumber2,
                    oAutoFillUserSettings.VertexAlphaDetails.UseLogs
                    );
        }

        AutoFillColumnViaCopy(oVertexTable,
            oAutoFillUserSettings.VertexLabelSourceColumnName,
            VertexTableColumnNames.Label
            );

        TryAutoFillColorColumn(oVertexTable,
            oAutoFillUserSettings.VertexLabelFillColorSourceColumnName,
            VertexTableColumnNames.LabelFillColor,
            oAutoFillUserSettings.VertexLabelFillColorDetails,
            out bSourceColumnContainsNumbers,
            out dSourceCalculationNumber1, out dSourceCalculationNumber2,
            out iDecimalPlaces, out oCategoryNames
            );

        AutoFillNumericComparisonColumn(oVertexTable,
            oAutoFillUserSettings.VertexLabelPositionSourceColumnName,
            VertexTableColumnNames.LabelPosition,
            oAutoFillUserSettings.VertexLabelPositionDetails
            );

        AutoFillColumnViaCopy(oVertexTable,
            oAutoFillUserSettings.VertexToolTipSourceColumnName,
            VertexTableColumnNames.ToolTip
            );

        AutoFillNumericComparisonColumn(oVertexTable,
            oAutoFillUserSettings.VertexVisibilitySourceColumnName,
            CommonTableColumnNames.Visibility,
            oAutoFillUserSettings.VertexVisibilityDetails
            );

        TryAutoFillNumericRangeColumn(oVertexTable,
            oAutoFillUserSettings.VertexLayoutOrderSourceColumnName,
            VertexTableColumnNames.LayoutOrder,
            oAutoFillUserSettings.VertexLayoutOrderDetails,
            out dSourceCalculationNumber1, out dSourceCalculationNumber2,
            out iDecimalPlaces
            );

        Boolean bXAutoFilled = TryAutoFillNumericRangeColumn(oVertexTable,
            oAutoFillUserSettings.VertexXSourceColumnName,
            VertexTableColumnNames.X,
            oAutoFillUserSettings.VertexXDetails,
            out dSourceCalculationNumber1, out dSourceCalculationNumber2,
            out iDecimalPlaces
            );

        Double dYSourceCalculationNumber1, dYSourceCalculationNumber2;

        Boolean bYAutoFilled = TryAutoFillNumericRangeColumn(oVertexTable,
            oAutoFillUserSettings.VertexYSourceColumnName,
            VertexTableColumnNames.Y,
            oAutoFillUserSettings.VertexYDetails,
            out dYSourceCalculationNumber1, out dYSourceCalculationNumber2,
            out iDecimalPlaces
            );

        if (bXAutoFilled && bYAutoFilled)
        {
            // (Note that the decimal places for the Y column take precedence
            // here.)

            oAutoFillWorkbookResults.VertexXResults =
                new AutoFillNumericRangeColumnResults(
                    oAutoFillUserSettings.VertexXSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.VertexXDetails.DestinationNumber1,
                    oAutoFillUserSettings.VertexXDetails.DestinationNumber2,
                    oAutoFillUserSettings.VertexXDetails.UseLogs
                    );

            oAutoFillWorkbookResults.VertexYResults =
                new AutoFillNumericRangeColumnResults(
                    oAutoFillUserSettings.VertexYSourceColumnName,
                    dYSourceCalculationNumber1, dYSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.VertexYDetails.DestinationNumber1,
                    oAutoFillUserSettings.VertexYDetails.DestinationNumber2,
                    oAutoFillUserSettings.VertexYDetails.UseLogs
                    );
        }

        TryAutoFillNumericRangeColumn(oVertexTable,
            oAutoFillUserSettings.VertexPolarRSourceColumnName,
            VertexTableColumnNames.PolarR,
            oAutoFillUserSettings.VertexPolarRDetails,
            out dSourceCalculationNumber1, out dSourceCalculationNumber2,
            out iDecimalPlaces
            );

        TryAutoFillNumericRangeColumn(oVertexTable,
            oAutoFillUserSettings.VertexPolarAngleSourceColumnName,
            VertexTableColumnNames.PolarAngle,
            oAutoFillUserSettings.VertexPolarAngleDetails,
            out dSourceCalculationNumber1, out dSourceCalculationNumber2,
            out iDecimalPlaces
            );
    }
    btnClear_Click
    (
        object sender,
        System.EventArgs e
    )
    {
        AssertValid();

        m_oGraphHistory = new GraphHistory();
        m_oAutoFillWorkbookResults = new AutoFillWorkbookResults();
        DoDataExchange(false);
    }
    FromString
    (
        String theString
    )
    {
        Debug.Assert( !String.IsNullOrEmpty(theString) );

        AutoFillWorkbookResults oAutoFillWorkbookResults =
            new AutoFillWorkbookResults();

        oAutoFillWorkbookResults.ConvertFromString(theString);

        return (oAutoFillWorkbookResults);
    }
    AutoFillGroupTable
    (
        ListObject oGroupTable,
        AutoFillUserSettings oAutoFillUserSettings,
        AutoFillWorkbookResults oAutoFillWorkbookResults
    )
    {
        Debug.Assert(oGroupTable != null);
        Debug.Assert(oAutoFillUserSettings != null);
        Debug.Assert(oAutoFillWorkbookResults != null);

        AutoFillNumericComparisonColumn(oGroupTable,
            oAutoFillUserSettings.GroupCollapsedSourceColumnName,
            GroupTableColumnNames.Collapsed,
            oAutoFillUserSettings.GroupCollapsedDetails
            );

        if (
            AutoFillColumnViaCopy(oGroupTable,
                oAutoFillUserSettings.GroupLabelSourceColumnName,
                GroupTableColumnNames.Label)
            &&
            oAutoFillUserSettings.GroupLabelDetails.PrependWithGroupName
            )
        {
            PrependGroupLabelsWithGroupNames(oGroupTable);
        }
    }
예제 #19
0
    TrySummarizeGraph
    (
        GraphHistory graphHistory,
        AutoFillWorkbookResults autoFillWorkbookResults,
        OverallMetrics overallMetrics,
        String topNByMetrics,
        String twitterSearchNetworkTopItems,
        out String graphSummary
    )
    {
        Debug.Assert(graphHistory != null);
        Debug.Assert(autoFillWorkbookResults != null);

        graphSummary = SummarizeGraphInternal(graphHistory,
            autoFillWorkbookResults, overallMetrics, topNByMetrics,
            twitterSearchNetworkTopItems);

        return ( ShowWarningIfNoGraphSummary(graphSummary) );
    }
    AutoFillTable
    (
        Microsoft.Office.Interop.Excel.Workbook oWorkbook,
        AutoFillUserSettings oAutoFillUserSettings,
        AutoFillWorkbookResults oAutoFillWorkbookResults,
        String sWorksheetName,
        String sTableName,
        AutoFillTableMethod oAutoFillTableMethod
    )
    {
        Debug.Assert(oWorkbook != null);
        Debug.Assert(oAutoFillUserSettings != null);
        Debug.Assert(oAutoFillWorkbookResults != null);
        Debug.Assert( !String.IsNullOrEmpty(sWorksheetName) );
        Debug.Assert( !String.IsNullOrEmpty(sTableName) );
        Debug.Assert(oAutoFillTableMethod != null);

        ListObject oTable;
        ExcelHiddenColumns oHiddenColumns;

        if (ExcelTableUtil.TryGetTable(oWorkbook, sWorksheetName, sTableName,
            out oTable) )
        {
            // The TableColumnMapper class that does the actual autofilling
            // fills only visible cells.  Temporarily show all hidden columns
            // in the table.

            oHiddenColumns = ExcelColumnHider.ShowHiddenColumns(oTable);

            try
            {
                oAutoFillTableMethod(oTable, oAutoFillUserSettings,
                    oAutoFillWorkbookResults);
            }
            finally
            {
                ExcelColumnHider.RestoreHiddenColumns(oTable, oHiddenColumns);
            }
        }
    }
예제 #21
0
    SummarizeGraphInternal
    (
        GraphHistory oGraphHistory,
        AutoFillWorkbookResults oAutoFillWorkbookResults,
        OverallMetrics oOverallMetrics,
        String oTopNByMetrics,
        String oTwitterSearchNetworkTopItems
    )
    {
        Debug.Assert(oGraphHistory != null);
        Debug.Assert(oAutoFillWorkbookResults != null);

        StringBuilder oStringBuilder = new StringBuilder();

        AppendGraphHistoryValues(oGraphHistory, oStringBuilder,
            GraphHistoryKeys.ImportDescription,
            GraphHistoryKeys.GraphDirectedness,
            GraphHistoryKeys.GroupingDescription,
            GraphHistoryKeys.LayoutAlgorithm
            );

        StringUtil.AppendLineAfterEmptyLine( oStringBuilder,
            oAutoFillWorkbookResults.ConvertToSummaryString() );

        if (oOverallMetrics != null)
        {
            StringUtil.AppendLineAfterEmptyLine(oStringBuilder,
                "Overall Graph Metrics:");

            oStringBuilder.AppendLine(
                oOverallMetrics.ConvertToSummaryString() );
        }

        StringUtil.AppendLineAfterEmptyLine(oStringBuilder, oTopNByMetrics);

        StringUtil.AppendLineAfterEmptyLine(oStringBuilder,
            oTwitterSearchNetworkTopItems);

        AppendGraphHistoryValues(oGraphHistory, oStringBuilder,
            GraphHistoryKeys.Comments
            );

        return ( oStringBuilder.ToString() );
    }
    AutoFillEdgeTable
    (
        ListObject oEdgeTable,
        AutoFillUserSettings oAutoFillUserSettings,
        AutoFillWorkbookResults oAutoFillWorkbookResults
    )
    {
        Debug.Assert(oEdgeTable != null);
        Debug.Assert(oAutoFillUserSettings != null);
        Debug.Assert(oAutoFillWorkbookResults != null);

        Boolean bSourceColumnContainsNumbers;
        Double dSourceCalculationNumber1, dSourceCalculationNumber2;
        Int32 iDecimalPlaces;
        ICollection<String> oCategoryNames;

        if ( TryAutoFillColorColumn(oEdgeTable,
                oAutoFillUserSettings.EdgeColorSourceColumnName,
                EdgeTableColumnNames.Color,
                oAutoFillUserSettings.EdgeColorDetails,
                out bSourceColumnContainsNumbers,
                out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                out iDecimalPlaces, out oCategoryNames
                ) )
        {
            oAutoFillWorkbookResults.EdgeColorResults =
                new AutoFillColorColumnResults(
                    bSourceColumnContainsNumbers,
                    oAutoFillUserSettings.EdgeColorSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.EdgeColorDetails.DestinationColor1,
                    oAutoFillUserSettings.EdgeColorDetails.DestinationColor2,
                    oCategoryNames
                    );
        }

        if ( TryAutoFillNumericRangeColumn(oEdgeTable,
                oAutoFillUserSettings.EdgeWidthSourceColumnName,
                EdgeTableColumnNames.Width,
                oAutoFillUserSettings.EdgeWidthDetails,
                out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                out iDecimalPlaces
                ) )
        {
            oAutoFillWorkbookResults.EdgeWidthResults =
                new AutoFillNumericRangeColumnResults(
                    oAutoFillUserSettings.EdgeWidthSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.EdgeWidthDetails.DestinationNumber1,
                    oAutoFillUserSettings.EdgeWidthDetails.DestinationNumber2,
                    oAutoFillUserSettings.EdgeWidthDetails.UseLogs
                    );
        }

        AutoFillNumericComparisonColumn(oEdgeTable,
            oAutoFillUserSettings.EdgeStyleSourceColumnName,
            EdgeTableColumnNames.Style, oAutoFillUserSettings.EdgeStyleDetails
            );

        if ( TryAutoFillNumericRangeColumn(oEdgeTable,
                oAutoFillUserSettings.EdgeAlphaSourceColumnName,
                CommonTableColumnNames.Alpha,
                oAutoFillUserSettings.EdgeAlphaDetails,
                out dSourceCalculationNumber1, out dSourceCalculationNumber2,
                out iDecimalPlaces
                ) )
        {
            oAutoFillWorkbookResults.EdgeAlphaResults =
                new AutoFillNumericRangeColumnResults(
                    oAutoFillUserSettings.EdgeAlphaSourceColumnName,
                    dSourceCalculationNumber1, dSourceCalculationNumber2,
                    iDecimalPlaces,
                    oAutoFillUserSettings.EdgeAlphaDetails.DestinationNumber1,
                    oAutoFillUserSettings.EdgeAlphaDetails.DestinationNumber2,
                    oAutoFillUserSettings.EdgeAlphaDetails.UseLogs
                    );
        }

        AutoFillNumericComparisonColumn(oEdgeTable,
            oAutoFillUserSettings.EdgeVisibilitySourceColumnName,
            CommonTableColumnNames.Visibility,
            oAutoFillUserSettings.EdgeVisibilityDetails
            );

        AutoFillColumnViaCopy(oEdgeTable,
            oAutoFillUserSettings.EdgeLabelSourceColumnName,
            EdgeTableColumnNames.Label
            );
    }