예제 #1
0
    public virtual Differences VisitFieldInitializerBlock(FieldInitializerBlock block1, FieldInitializerBlock block2){
      Differences differences = new Differences(block1, block2);
      if (block1 == null || block2 == null){
        if (block1 != block2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      Filter changes = (Filter)block2.Clone();
      Filter deletions = (Filter)block2.Clone();
      Filter insertions = (Filter)block2.Clone();
      
      if (block1.IsStatic == block2.IsStatic) differences.NumberOfSimilarities++; else differences.NumberOfDifferences++;

      if (differences.NumberOfDifferences == 0){
        differences.Changes = null;
        differences.Deletions = null;
        differences.Insertions = null;
      }else{
        differences.Changes = changes;
        differences.Deletions = deletions;
        differences.Insertions = insertions;
      }
      return differences;
    }
예제 #2
0
 public override Block VisitFieldInitializerBlock(FieldInitializerBlock block)
 {
     if (block == null) return null;
     return base.VisitFieldInitializerBlock((FieldInitializerBlock)block.Clone());
 }