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; }
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); } }
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); }
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()); }
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); }
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; }
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 ); }
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); } }
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); } } }
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 ); }