Exemplo n.º 1
0
		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;
		}
Exemplo n.º 2
0
		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;
		}