public void CtorTest ()
		{
			LookupBindingPropertiesAttribute a, b, c, d;

			a = new LookupBindingPropertiesAttribute ();
			Assert.IsNull (a.DataSource, "#A1");
			Assert.IsNull (a.DisplayMember, "#A2");
			Assert.IsNull (a.ValueMember, "#A3");
			Assert.IsNull (a.LookupMember, "#A4");

			b = new LookupBindingPropertiesAttribute ("aa", "bb", "cc", "dd");
			Assert.AreSame ("aa", b.DataSource, "#B1");
			Assert.AreSame ("bb", b.DisplayMember, "#B2");
			Assert.AreSame ("cc", b.ValueMember, "#B3");
			Assert.AreSame ("dd", b.LookupMember, "#B4");

			c = new LookupBindingPropertiesAttribute ("aa", "bb", "cc", "dd");

			Assert.AreEqual ("aa", c.DataSource, "#C1");
			Assert.AreEqual ("bb", c.DisplayMember, "#C2");
			Assert.AreEqual ("cc", c.ValueMember, "#C3");
			Assert.AreEqual ("dd", c.LookupMember, "#C4");

			Assert.IsTrue (b.Equals (c), "#Eq1");
			Assert.AreEqual (b.GetHashCode (), c.GetHashCode (), "#Hash");

			d = LookupBindingPropertiesAttribute.Default;
			Assert.IsNull (d.DataSource, "#D1");
			Assert.IsNull (d.DisplayMember, "#D2");
			Assert.IsNull (d.ValueMember, "#D3");
			Assert.IsNull (d.LookupMember, "#D4");

			Assert.IsTrue (d.Equals (a), "#Eq2");
			Assert.IsFalse (a.Equals (b), "#Eq3");
		}
        public override bool Equals(object obj)
        {
            LookupBindingPropertiesAttribute attribute = obj as LookupBindingPropertiesAttribute;

            return((((attribute != null) && (attribute.DataSource == this.dataSource)) && ((attribute.displayMember == this.displayMember) && (attribute.valueMember == this.valueMember))) && (attribute.lookupMember == this.lookupMember));
        }
示例#3
0
 static LookupBindingPropertiesAttribute()
 {
     Default = new LookupBindingPropertiesAttribute();
 }
		static LookupBindingPropertiesAttribute()
		{
			Default = new LookupBindingPropertiesAttribute ();
		}