本文整理匯總了C#中Mono.Cecil.MethodDefinition.Reuses方法的典型用法代碼示例。如果您正苦於以下問題:C# MethodDefinition.Reuses方法的具體用法?C# MethodDefinition.Reuses怎麽用?C# MethodDefinition.Reuses使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.Cecil.MethodDefinition
的用法示例。
在下文中一共展示了MethodDefinition.Reuses方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: VisitMethod
public void VisitMethod(MethodDefinition method)
{
Log.DebugLine(this, "{0}", method.Name);
if (!m_type.IsNestedPrivate && m_type.IsValueType && !m_needsCheck && method.IsVirtual)
{
if (method.Reuses("System.Boolean", "Equals", "System.Object"))
{
m_needsCheck = true;
}
}
}
示例2: VisitMethod
public void VisitMethod(MethodDefinition method)
{
if (m_needsCheck)
{
if (method.Reuses("System.Boolean", "Equals", "System.Object"))
{
Log.DebugLine(this, "{0}", method);
m_foundEquals = true;
}
else if (method.Matches("System.Int32", "CompareTo", method.DeclaringType.FullName))
{
Log.DebugLine(this, "{0}", method);
m_foundCompare = true;
}
}
}
示例3: VisitMethod
public void VisitMethod(MethodDefinition method)
{
if (method.IsPublic)
{
Log.DebugLine(this, "{0}", method);
if (method.Name == "op_Addition")
{
m_hasAdd = true;
}
else if (method.Name == "op_Subtraction")
{
m_hasMinus = true;
}
else if (method.Reuses("System.Boolean", "Equals", "System.Object"))
{
m_hasEquals = true;
}
}
}
示例4: DoIsEquals
// Return true if the method matches one of:
// public override bool Equals(object)
// public bool Equals(xxx), where xxx is not a value type
private static bool DoIsEquals(MethodDefinition method)
{
bool equals = false;
if (method.Reuses("System.Boolean", "Equals", "System.Object"))
equals = true;
else if (method.Matches("System.Boolean", "Equals", method.DeclaringType.FullName))
if (!method.IsStatic)
if (!method.Parameters[0].ParameterType.IsValueType)
equals = true;
return equals;
}