本文整理汇总了C#中TypeReference.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# TypeReference.Clone方法的具体用法?C# TypeReference.Clone怎么用?C# TypeReference.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeReference
的用法示例。
在下文中一共展示了TypeReference.Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitTypeReference
public virtual Differences VisitTypeReference(TypeReference reference1, TypeReference reference2){
Differences differences = new Differences(reference1, reference2);
if (reference1 == null || reference2 == null){
if (reference1 != reference2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
return differences;
}
UnaryExpression changes = (UnaryExpression)reference2.Clone();
UnaryExpression deletions = (UnaryExpression)reference2.Clone();
UnaryExpression insertions = (UnaryExpression)reference2.Clone();
Differences diff = this.VisitTypeNode(reference1.Type, reference2.Type);
if (diff == null){Debug.Assert(false); return differences;}
changes.Type = diff.Changes as TypeNode;
deletions.Type = diff.Deletions as TypeNode;
insertions.Type = diff.Insertions as TypeNode;
//Debug.Assert(diff.Changes == changes.Type && diff.Deletions == deletions.Type && diff.Insertions == insertions.Type);
differences.NumberOfDifferences += diff.NumberOfDifferences;
differences.NumberOfSimilarities += diff.NumberOfSimilarities;
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;
}