本文整理汇总了C#中Mono.Cecil.MethodDefinition.Matches方法的典型用法代码示例。如果您正苦于以下问题:C# MethodDefinition.Matches方法的具体用法?C# MethodDefinition.Matches怎么用?C# MethodDefinition.Matches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.MethodDefinition
的用法示例。
在下文中一共展示了MethodDefinition.Matches方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
}
示例2: DoIsIFormattableToString
private static bool DoIsIFormattableToString(MethodDefinition method)
{
bool equals = false;
if (method.Parameters.Count == 2 && method.IsVirtual)
{
if (method.Matches("System.String", "ToString", "System.String", "System.IFormatProvider"))
equals = true;
else if (method.Matches("System.String", "System.IFormattable.ToString", "System.String", "System.IFormatProvider"))
equals = true;
}
return equals;
}
示例3: DoIsOperatorEquals
// Return true if the method matches:
// public static bool operator==(xxx, xxx), where xxx is not a value type
private static bool DoIsOperatorEquals(MethodDefinition method)
{
bool equals = false;
if (method.IsStatic)
if (method.Matches("System.Boolean", "op_Equality", method.DeclaringType.FullName, method.DeclaringType.FullName))
if (!method.Parameters[0].ParameterType.IsValueType)
equals = true;
return equals;
}
示例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;
}