예제 #1
0
		public static new bool Equals (object o1, object o2) {
			// LAMESPEC: According to MSDN, this is equivalent to 
			// Object::Equals (). But the MS version of Object::Equals()
			// includes the functionality of ValueType::Equals(), while
			// our version does not.
			if (o1 == o2)
				return true;
			if ((o1 == null) || (o2 == null))
				return false;
			if (o1 is ValueType)
				return ValueType.DefaultEquals (o1, o2);
			else
				return Object.Equals (o1, o2);
		}
예제 #2
0
 /// <summary>Determines whether the specified <see cref="T:System.Object" /> instances are considered equal.</summary>
 /// <returns>true if the <paramref name="o1" /> parameter is the same instance as the <paramref name="o2" /> parameter or if both are null or if o1.Equals(o2) returns true; otherwise, false.</returns>
 /// <param name="o1">The first <see cref="T:System.Object" /> to compare. </param>
 /// <param name="o2">The second <see cref="T:System.Object" /> to compare. </param>
 public new static bool Equals(object o1, object o2)
 {
     if (o1 == o2)
     {
         return(true);
     }
     if (o1 == null || o2 == null)
     {
         return(false);
     }
     if (o1 is ValueType)
     {
         return(ValueType.DefaultEquals(o1, o2));
     }
     return(object.Equals(o1, o2));
 }