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

Match() public method

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

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

Usage Example

		public void MatchTest () {
			DataObjectMethodAttribute a1 = new DataObjectMethodAttribute (DataObjectMethodType.Fill);
			DataObjectMethodAttribute a2 = new DataObjectMethodAttribute (DataObjectMethodType.Delete, true);

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

			DataObjectMethodAttribute a3 = new DataObjectMethodAttribute (DataObjectMethodType.Delete);

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