示例#1
0
		public void Deny_Unrestricted ()
		{
			DataBindingCollection dbc = new DataBindingCollection ();
			Assert.AreEqual (0, dbc.Count, "Count");
			Assert.IsFalse (dbc.IsReadOnly, "IsReadOnly");
			Assert.IsFalse (dbc.IsSynchronized, "IsSynchronized");
			dbc.Add (db);
			Assert.AreSame (db, dbc["property"], "this[string]");
			Assert.IsNotNull (dbc.RemovedBindings, "RemovedBindings");
			Assert.IsNotNull (dbc.SyncRoot, "SyncRoot");
			Assert.IsNotNull (dbc.GetEnumerator (), "GetEnumerator");
			dbc.CopyTo (new DataBinding[1], 0);
			dbc.Clear ();

			dbc.Add (db);
			dbc.Remove (db);

			dbc.Add (db);
			dbc.Remove ("property");
			dbc.Remove ("property", true);
#if NET_2_0
			dbc.Changed += new EventHandler (Handler);
			Assert.IsFalse (dbc.Contains ("property"), "Contains");
			dbc.Changed -= new EventHandler (Handler);
#endif
		}