本文整理匯總了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);
}
}
}