Exemplo n.º 1
0
		public void VisitMethod(MethodDefinition method)
		{			
			Log.DebugLine(this, "{0}", method.Name);				

			if (!m_type.IsNestedPrivate && m_type.IsValueType && !m_needsCheck && method.IsVirtual)
			{
				if (method.Reuses("System.Boolean", "Equals", "System.Object"))
				{
					m_needsCheck = true;
				}
			}			
		}
Exemplo n.º 2
0
		public void VisitMethod(MethodDefinition method)
		{
			if (m_needsCheck)
			{
				if (method.Reuses("System.Boolean", "Equals", "System.Object"))
				{
					Log.DebugLine(this, "{0}", method); 
					m_foundEquals = true;
				}
				else if (method.Matches("System.Int32", "CompareTo", method.DeclaringType.FullName))
				{
					Log.DebugLine(this, "{0}", method); 
					m_foundCompare = true;
				}
			}
		}
Exemplo n.º 3
0
		public void VisitMethod(MethodDefinition method)
		{								
			if (method.IsPublic)
			{
				Log.DebugLine(this, "{0}", method);
				if (method.Name == "op_Addition")
				{
					m_hasAdd = true;
				}
				else if (method.Name == "op_Subtraction")
				{
					m_hasMinus = true;
				}
				else if (method.Reuses("System.Boolean", "Equals", "System.Object"))
				{
					m_hasEquals = true;
				}
			}
		}
		// Return true if the method matches one of:
		// 		public override bool Equals(object)
		// 		public bool Equals(xxx), where xxx is not a value type
		private static bool DoIsEquals(MethodDefinition method)
		{
			bool equals = false;
			
			if (method.Reuses("System.Boolean", "Equals", "System.Object"))
				equals = true;
			
			else if (method.Matches("System.Boolean", "Equals", method.DeclaringType.FullName))
				if (!method.IsStatic)
					if (!method.Parameters[0].ParameterType.IsValueType)
						equals = true;
			
			return equals;
		}