本文整理汇总了C#中Mono.Cecil.TypeDefinition.TypeImplements方法的典型用法代码示例。如果您正苦于以下问题:C# TypeDefinition.TypeImplements方法的具体用法?C# TypeDefinition.TypeImplements怎么用?C# TypeDefinition.TypeImplements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mono.Cecil.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.TypeImplements方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitType
public void VisitType(TypeDefinition type)
{
if (type.TypeImplements("System.Collections.ICollection"))
{
if (!type.TypeImplements("System.Collections.IDictionary") && !type.TypeImplements("System.Collections.IList"))
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "{0} failed", type);
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
}
示例2: VisitType
public void VisitType(TypeDefinition type)
{
if (type.TypeImplements("System.Collections.IEnumerator") && !type.IsCompilerGenerated())
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "checking {0}", type);
PropertyDefinition[] properties = type.Properties.GetProperties("Current");
bool found = false;
foreach (PropertyDefinition prop in properties)
{
if (prop.PropertyType.ToString() != "System.Object")
{
found = true;
break;
}
}
if (!found)
{
Log.DebugLine(this, "no strongly typed Current");
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
}
示例3: VisitType
public void VisitType(TypeDefinition type)
{
if (!type.IsInterface)
{
if (type.TypeImplements("System.Collections.IEnumerable") && !type.TypeImplements("System.Collections.IDictionary"))
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "{0}", type);
if (!type.TypeImplements("System.Collections.Generic.IEnumerable"))
{
Log.DebugLine(this, "no Generic.IEnumerable");
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
}
}
示例4: VisitType
public void VisitType(TypeDefinition type)
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "checking {0}", type);
if (type.TypeImplements("System.ICloneable"))
{
Log.DebugLine(this, "ICloneable");
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
示例5: VisitType
public void VisitType(TypeDefinition type)
{
if (type.TypeImplements("System.Runtime.Serialization.ISerializable"))
{
Log.DebugLine(this, "-----------------------------------");
Log.DebugLine(this, "{0}", type);
if ((type.Attributes & TypeAttributes.Serializable) == 0)
{
Log.DebugLine(this, "no SerializeAttribute");
Reporter.TypeFailed(type, CheckID, string.Empty);
}
}
}