當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。