コード例 #1
0
 private static SignatureDifferenceType HighestDifferenceLevel(IApiNodeComparison nodeComparison)
 {
     return
         nodeComparison.MemberComparison.Select(HighestDifferenceLevel)
             .Concat(new[] {nodeComparison.SignatureDifferenceType})
             .Max();
 }
コード例 #2
0
 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);
     }
 }
コード例 #4
0
        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();
     }
 }
コード例 #6
0
        private string ChangeTypeIndicator(IApiNodeComparison nodeComparison)
        {
            switch (nodeComparison.SignatureDifferenceType)
            {
            case SignatureDifferenceType.SignatureSame:
                return(" ");

            case SignatureDifferenceType.Added:
                return("+");

            case SignatureDifferenceType.Removed:
                return("-");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
コード例 #7
0
 private static IOrderedEnumerable <IApiNodeComparison> MembersInCanonicalOrder(IApiNodeComparison apiNode)
 {
     return(apiNode.MemberComparison
            .OrderByDescending(m => m.Get(n => n), new PrettyNodeOrderComparer()));
 }
コード例 #8
0
 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());
 }
 private async Task WriteLineStart(IApiNodeComparison apiComparison, TextWriter file, int indentLevel)
 {
     file.WriteLine();
     await file.WriteAsync(ChangeTypeIndicator(apiComparison) + new string(' ', indentLevel * 2 + 1));
 }