public override string GetToolTip(TreeNodeAdv node) { AssemblyGroup grp = ((AssemblyGroupTreeItem)node.Tag).Group; string tip = "Assembly " + grp.Name; if (grp.HasErrors) { tip += " failed to load. Check log messages for detailed error information."; } else if (ChangeTypeUtil.HasBreaking(grp.Change)) { tip += " has breaking changes."; } else if (ChangeTypeUtil.HasNonBreaking(grp.Change)) { tip += " has non-breaking changes."; } else { tip += " has no changes."; } return(tip); }
protected virtual void ProcessChildChange(Type childType, ChangeType change) { if (change != ChangeType.None) { if (childType == typeof(AttributeDetail)) { _changeAllChildren |= ChangeType.AttributesChanged; } else { if (this.CollapseChildren) { CollapseChildChange(change); } else { if (ChangeTypeUtil.HasBreaking(change)) { _changeAllChildren |= ChangeType.MembersChangedBreaking; } if (ChangeTypeUtil.HasNonBreaking(change)) { _changeAllChildren |= ChangeType.MembersChangedNonBreaking; } } } } }
public void WriteMarkdownDescription(TextWriter tw) { tw.WriteLine($"# {_name}"); tw.WriteLine(); if (_hasErrors) { tw.WriteLine("```"); if (string.IsNullOrEmpty(_errorDetail)) { tw.WriteLine("Failed to load one or more versions of this assembly. Examine the log messages pane for detailed error information."); } else { tw.WriteLine("Failed to load one or more versions of this assembly:"); tw.WriteLine(_errorDetail); } tw.WriteLine("```"); } else { if (_change == ChangeType.None) { if (_assemblies.Count == 1) { tw.WriteLine("Only one version of this assembly was found (nothing to compare to!)"); tw.WriteLine(); } else { tw.WriteLine("No changes were found across all versions of this assembly."); tw.WriteLine(); } } else if (ChangeTypeUtil.HasBreaking(_change)) { tw.WriteLine("**Breaking changes were found between versions of this assembly.**"); tw.WriteLine(); } else if (ChangeTypeUtil.HasNonBreaking(_change)) { tw.WriteLine("Non-breaking changes were found between versions of this assembly."); tw.WriteLine(); } tw.WriteLine("The following files have been compared in this set:"); tw.WriteLine(); foreach (AssemblyDetail detail in _assemblies) { tw.WriteLine($"* {MarkdownUtility.ToInlineCode(detail.Location)}"); } tw.WriteLine(); } }
public void WriteHtmlDescription(TextWriter tw) { tw.Write("<p class='hdr1'>Assembly '"); tw.Write(_name); tw.Write("'</p>"); if (_hasErrors) { if (string.IsNullOrEmpty(_errorDetail)) { tw.Write("<p style='color:red'>Failed to load one or more versions of this assembly. Examine the log messages pane for detailed error information.</p>"); } else { tw.Write("<p style='color:red'>Failed to load one or more versions of this assembly: " + _errorDetail + "</p>"); } } else { if (_change == ChangeType.None) { if (_assemblies.Count == 1) { tw.Write("<p>Only one version of this assembly was found (nothing to compare to!)</p>"); } else { tw.Write("<p>No changes were found across all versions of this assembly.</p>"); } } else if (ChangeTypeUtil.HasBreaking(_change)) { tw.Write("<p style='color:red'>Breaking changes were found between versions of this assembly.</p>"); } else if (ChangeTypeUtil.HasNonBreaking(_change)) { tw.Write("<p>Non-breaking changes were found between versions of this assembly.</p>"); } tw.Write("<p>The following files have been compared in this set:</p>"); tw.Write("<ul>"); foreach (AssemblyDetail detail in _assemblies) { tw.Write("<li>"); tw.Write(detail.Location); tw.Write("</li>"); } tw.Write("</ul>"); } }
public void PerformCompare(ComparisonFilter filter) { for (int i = 1; i < _assemblies.Count; i++) { _assemblies[i].PerformCompare(_assemblies[i - 1]); _assemblies[i].ApplyFilter(filter); } _change = ChangeType.None; foreach (AssemblyDetail ad in _assemblies) { if (ChangeTypeUtil.HasBreaking(ad.Change)) { _change = ChangeType.MembersChangedBreaking; break; } else if (ChangeTypeUtil.HasNonBreaking(ad.Change)) { _change = ChangeType.MembersChangedNonBreaking; } } }
private void AssemblyGroupNodeControl_DrawText(object sender, DrawEventArgs e) { if (e.TextColor != SystemColors.ControlText) { return; } AssemblyGroup grp = ((AssemblyGroupTreeItem)e.Node.Tag).Group; e.TextColor = Color.Gray; if (grp.HasErrors) { e.TextColor = Color.LightGray; } else if (ChangeTypeUtil.HasBreaking(grp.Change)) { e.TextColor = Color.Red; } else if (ChangeTypeUtil.HasNonBreaking(grp.Change)) { e.TextColor = Color.Black; } }
protected virtual void ProcessChildChange(RootDetail child, ChangeType change) { if (change != ChangeType.None) { if (child is AttributeDetail attributeDetail) { if (attributeDetail.AttributeType != AttributeType.CompilerGenerated) { _changeAllChildren |= ChangeType.AttributesChanged; if (this.CollapseChildren) { _changeThisInstance |= ChangeType.AttributesChanged; } } } else { if (this.CollapseChildren) { CollapseChildChange(change); } else { if (ChangeTypeUtil.HasBreaking(change)) { _changeAllChildren |= ChangeType.MembersChangedBreaking; } if (ChangeTypeUtil.HasNonBreaking(change)) { _changeAllChildren |= ChangeType.MembersChangedNonBreaking; } } } } }