本文整理汇总了C#中Annotation.annotationType方法的典型用法代码示例。如果您正苦于以下问题:C# Annotation.annotationType方法的具体用法?C# Annotation.annotationType怎么用?C# Annotation.annotationType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation.annotationType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equals
/// <summary>
/// This is used to determine if two annotations are equals based
/// on the attributes of the annotation. The comparison done can
/// ignore specific attributes, for instance the name attribute.
/// </summary>
/// <param name="left">
/// this is the left side of the comparison done
/// </param>
/// <param name="right">
/// this is the right side of the comparison done
/// </param>
/// <returns>
/// this returns true if the annotations are equal
/// </returns>
public bool Equals(Annotation left, Annotation right) {
Class type = left.annotationType();
Method[] list = type.getDeclaredMethods();
for(Method method : list) {
if(!IsIgnore(method)) {
Object value = method.invoke(left);
Object other = method.invoke(right);
if(!value.Equals(other)) {
return false;
}
}
}
return true;
}