private static SignatureDifferenceType HighestDifferenceLevel(IApiNodeComparison nodeComparison) { return nodeComparison.MemberComparison.Select(HighestDifferenceLevel) .Concat(new[] {nodeComparison.SignatureDifferenceType}) .Max(); }
private static SignatureDifferenceType HighestDifferenceLevel(IApiNodeComparison nodeComparison) { return (nodeComparison.MemberComparison.Select(HighestDifferenceLevel) .Concat(new[] { nodeComparison.SignatureDifferenceType }) .Max()); }
public async Task Write(IApiNodeComparison apiComparison, TextWriter file, CancellationToken cancellationToken, int indentLevel = 0) { await WriteLineStart(apiComparison, file, indentLevel); await m_ApiNodeWriter.Write(apiComparison.Get(n => n), file, cancellationToken, false); var orderedMembers = MembersInCanonicalOrder(apiComparison); foreach (var member in orderedMembers) { await Write(member, file, cancellationToken, indentLevel + 1); } }
private string ChangeTypeIndicator(IApiNodeComparison nodeComparison) { switch (nodeComparison.SignatureDifferenceType) { case SignatureDifferenceType.SignatureSame: return " "; case SignatureDifferenceType.Added: return "+"; case SignatureDifferenceType.Removed: return "-"; default: throw new ArgumentOutOfRangeException(); } }
private string ChangeTypeIndicator(IApiNodeComparison nodeComparison) { switch (nodeComparison.SignatureDifferenceType) { case SignatureDifferenceType.SignatureSame: return(" "); case SignatureDifferenceType.Added: return("+"); case SignatureDifferenceType.Removed: return("-"); default: throw new ArgumentOutOfRangeException(); } }
private static IOrderedEnumerable <IApiNodeComparison> MembersInCanonicalOrder(IApiNodeComparison apiNode) { return(apiNode.MemberComparison .OrderByDescending(m => m.Get(n => n), new PrettyNodeOrderComparer())); }
private async Task WriteLineStart(IApiNodeComparison apiComparison, TextWriter file, int indentLevel) { file.WriteLine(); await file.WriteAsync(ChangeTypeIndicator(apiComparison) + new string(' ', indentLevel * 2 + 1)); }
public DifferentOnlyApiNodeComparison(IApiNodeComparison apiNodeComparison) { m_ApiNodeComparison = apiNodeComparison; }
private static IOrderedEnumerable<IApiNodeComparison> MembersInCanonicalOrder(IApiNodeComparison apiNode) { return apiNode.MemberComparison .OrderByDescending(m => m.Get(n => n), new PrettyNodeOrderComparer()); }