Esempio n. 1
0
		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);
				}
			}
		}
Esempio n. 2
0
		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);
				}
			}
		}
		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);
					}
				}				
			}
		}
Esempio n. 4
0
		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);
			}
		}
		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);
				}
			}
		}