当前位置: 首页>>代码示例>>C#>>正文


C# TypeDefinition.TypeOrBaseImplements方法代码示例

本文整理汇总了C#中Mono.Cecil.TypeDefinition.TypeOrBaseImplements方法的典型用法代码示例。如果您正苦于以下问题:C# TypeDefinition.TypeOrBaseImplements方法的具体用法?C# TypeDefinition.TypeOrBaseImplements怎么用?C# TypeDefinition.TypeOrBaseImplements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mono.Cecil.TypeDefinition的用法示例。


在下文中一共展示了TypeDefinition.TypeOrBaseImplements方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoTypeFailed

		private bool DoTypeFailed(TypeDefinition type)
		{
			bool failed = false;
			
			if (DoCheckSuffix(type, "Attribute"))
				failed = !type.IsSubclassOf("System.Attribute", Cache);
				
			else if (DoCheckSuffix(type, "Queue"))
				failed = !type.IsSubclassOf("System.Collections.Queue", Cache);

			else if (DoCheckSuffix(type, "Dictionary"))
				failed = !type.TypeOrBaseImplements("System.Collections.IDictionary", Cache);

			else if (DoCheckSuffix(type, "Stack"))
				failed = !type.IsSubclassOf("System.Collections.Stack", Cache);				

			else if (DoCheckSuffix(type, "Collection"))
				failed = !type.IsSubclassOf("System.Collections.Queue", Cache) &&
					!type.IsSubclassOf("System.Collections.Stack", Cache) &&
					!type.IsSubclassOf("System.Data.DataSet", Cache) &&
					!type.IsSubclassOf("System.Data.DataTable", Cache) &&
					!type.TypeOrBaseImplements("System.Collections.ICollection", Cache) &&
					!type.TypeOrBaseImplements("System.Collections.IEnumerable", Cache) &&
					!type.TypeOrBaseImplements("System.Collections.Generic.ICollection", Cache);
				
			else if (DoCheckSuffix(type, "EventArgs"))
				failed = !type.IsSubclassOf("System.EventArgs", Cache);
				
			else if (DoCheckSuffix(type, "Exception"))
				failed = !type.IsSubclassOf("System.Exception", Cache);
				
			else if (DoCheckSuffix(type, "Stream"))
				failed = !type.IsSubclassOf("System.IO.Stream", Cache);				
													
			else if (DoCheckSuffix(type, "Permission"))
				failed = !type.TypeOrBaseImplements("System.Security.IPermission", Cache);

			return failed;
		}
开发者ID:dbremner,项目名称:smokey,代码行数:39,代码来源:SuffixName2Rule.cs

示例2: DoInterfaceFailed

		private bool DoInterfaceFailed(TypeDefinition type)
		{
			bool failed = false;
			
			if (type.TypeOrBaseImplements("System.Collections.IDictionary", Cache))	
				failed = DoCheckSuffix(type, "Dictionary");
				
			else if (type.TypeOrBaseImplements("System.Collections.Generic.IDictionary", Cache))	
				failed = DoCheckSuffix(type, "Dictionary");
				
			else if (type.TypeOrBaseImplements("System.Collections.ICollection", Cache))	
				failed = DoCheckSuffix(type, "Collection");
				
			else if (type.TypeOrBaseImplements("System.Collections.Generic.ICollection", Cache))	
				failed = DoCheckSuffix(type, "Collection");
				
			else if (type.TypeOrBaseImplements("System.Collections.IEnumerable", Cache))	
				failed = DoCheckSuffix(type, "Collection");
				
			else if (type.TypeOrBaseImplements("System.Security.IPermission", Cache))	
				failed = DoCheckSuffix(type, "Permission");
				
			else if (type.TypeOrBaseImplements("System.Security.Policy.IMembershipCondition", Cache))	
				failed = DoCheckSuffix(type, "Condition");
							
			return failed;
		}
开发者ID:dbremner,项目名称:smokey,代码行数:27,代码来源:SuffixNameRule.cs


注:本文中的Mono.Cecil.TypeDefinition.TypeOrBaseImplements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。