System.ComponentModel.DataObjectMethodAttribute.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(object obj) {
            if (obj == this) {
                return true;
            }

            DataObjectMethodAttribute other = obj as DataObjectMethodAttribute;
            return (other != null) && (other.MethodType == MethodType) && (other.IsDefault == IsDefault);
        }

Usage Example

		public void EqualsTest () {
			DataObjectMethodAttribute a1 = new DataObjectMethodAttribute (DataObjectMethodType.Fill);
			DataObjectMethodAttribute a2 = new DataObjectMethodAttribute (DataObjectMethodType.Delete);

			Assert.IsFalse (a1.Equals (a2), "#1");

			DataObjectMethodAttribute a3 = new DataObjectMethodAttribute (DataObjectMethodType.Delete);

			Assert.IsTrue (a2.Equals (a3), "#2");
		}