CreateGraphTitle ( Microsoft.Office.Interop.Excel.Workbook workbook ) { Debug.Assert(workbook != null); GraphHistory oGraphHistory = (new PerWorkbookSettings(workbook)).GraphHistory; String sGraphTitle; // Order of precedence: suggested title, suggested file name, // workbook name. if ( !oGraphHistory.TryGetValue( GraphHistoryKeys.ImportSuggestedTitle, out sGraphTitle) && !oGraphHistory.TryGetValue( GraphHistoryKeys.ImportSuggestedFileNameNoExtension, out sGraphTitle) ) { Debug.Assert(!String.IsNullOrEmpty(workbook.Name)); sGraphTitle = workbook.Name; } return(sGraphTitle); }
btnClear_Click ( object sender, System.EventArgs e ) { AssertValid(); m_oGraphHistory = new GraphHistory(); m_oAutoFillWorkbookResults = new AutoFillWorkbookResults(); DoDataExchange(false); }
FromString ( String attributes ) { Debug.Assert(attributes != null); GraphHistory oGraphHistory = new GraphHistory(); PopulateDictionary(oGraphHistory, attributes); return (oGraphHistory); }
FromString ( String attributes ) { Debug.Assert(attributes != null); GraphHistory oGraphHistory = new GraphHistory(); PopulateDictionary(oGraphHistory, attributes); return(oGraphHistory); }
SetGraphHistoryValue ( String graphHistoryKey, String graphHistoryValue ) { Debug.Assert(!String.IsNullOrEmpty(graphHistoryKey)); AssertValid(); GraphHistory oGraphHistory = this.GraphHistory; oGraphHistory[graphHistoryKey] = graphHistoryValue; this.GraphHistory = oGraphHistory; }
ClearGraphHistory() { AssertValid(); // Clear everything except the comments, if there are any. GraphHistory oNewGraphHistory = new GraphHistory(); String sComments; if (this.GraphHistory.TryGetValue(GraphHistoryKeys.Comments, out sComments)) { oNewGraphHistory[GraphHistoryKeys.Comments] = sComments; } this.GraphHistory = oNewGraphHistory; }
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); }
AppendGraphHistoryValues ( GraphHistory oGraphHistory, StringBuilder oStringBuilder, params String [] asGraphHistoryKeys ) { Debug.Assert(oGraphHistory != null); Debug.Assert(oStringBuilder != null); Debug.Assert(asGraphHistoryKeys != null); String sGraphHistoryValue; foreach (String sGraphHistoryKey in asGraphHistoryKeys) { if (oGraphHistory.TryGetValue(sGraphHistoryKey, out sGraphHistoryValue)) { StringUtil.AppendLineAfterEmptyLine(oStringBuilder, sGraphHistoryValue); } } }
AppendGraphHistoryValues ( GraphHistory oGraphHistory, StringBuilder oStringBuilder, params String [] asGraphHistoryKeys ) { Debug.Assert(oGraphHistory != null); Debug.Assert(oStringBuilder != null); Debug.Assert(asGraphHistoryKeys != null); String sGraphHistoryValue; foreach (String sGraphHistoryKey in asGraphHistoryKeys) { if ( oGraphHistory.TryGetValue(sGraphHistoryKey, out sGraphHistoryValue) ) { StringUtil.AppendLineAfterEmptyLine(oStringBuilder, sGraphHistoryValue); } } }
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 ( ShowWarningIfNoGraphSummary(graphSummary) ); }
//************************************************************************* // Constructor: TwitterSearchNetworkTopItemsCalculator2() // /// <summary> /// Initializes a new instance of the <see /// cref="TwitterSearchNetworkTopItemsCalculator2" /> class. /// </summary> /// /// <param name="graphHistory"> /// Describes how the graph was created. /// </param> //************************************************************************* public TwitterSearchNetworkTopItemsCalculator2 ( GraphHistory graphHistory ) { m_oGraphHistory = graphHistory; m_oTwitterStatusTextParser = new TwitterStatusTextParser(); AssertValid(); }
ClearGraphHistory() { AssertValid(); // Clear everything except the comments, if there are any. GraphHistory oNewGraphHistory = new GraphHistory(); String sComments; if ( this.GraphHistory.TryGetValue(GraphHistoryKeys.Comments, out sComments) ) { oNewGraphHistory[GraphHistoryKeys.Comments] = sComments; } this.GraphHistory = oNewGraphHistory; }
SetGraphHistoryValue ( String graphHistoryKey, String graphHistoryValue ) { Debug.Assert( !String.IsNullOrEmpty(graphHistoryKey) ); AssertValid(); GraphHistory oGraphHistory = this.GraphHistory; oGraphHistory[graphHistoryKey] = graphHistoryValue; this.GraphHistory = oGraphHistory; }
btnClear_Click ( object sender, System.EventArgs e ) { AssertValid(); m_oGraphHistory = new GraphHistory(); m_oAutoFillWorkbookResults = new AutoFillWorkbookResults(); DoDataExchange(false); }