Remove() public method

Removes a component from the .

public Remove ( IComponent component ) : void
component IComponent
return void
Exemplo n.º 1
0
		public void SetDraggable(Control control, bool value)
		{
			if (value)
			{
				if (!GetDraggable(control))
				{
					this._container.Add(control);
					control.MouseDown+=new MouseEventHandler(control_MouseDown);
				}
			} 
			else
				if (GetDraggable(control))
			{
				_container.Remove(control);
			}
		
		}
Exemplo n.º 2
0
		public void NameTest ()
		{
			Container container = new Container ();
			Component owner = new Component ();
			container.Add (owner, "OwnerName");
			NestedContainerTest nestedContainer = new NestedContainerTest (owner);
			Component nestedComponent = new Component ();
			nestedContainer.Add (nestedComponent, "NestedComponentName");

			Assert.AreEqual ("OwnerName", nestedContainer.OwnerName, "#1");
			Assert.AreEqual ("OwnerName.NestedComponentName", ((INestedSite)nestedComponent.Site).FullName, "#2");
			// Prooves that MSDN is wrong.
			Assert.AreEqual ("NestedComponentName", nestedComponent.Site.Name, "#3");

			container.Remove (owner);
			Assert.AreEqual (null, nestedContainer.OwnerName, "#4");
			Assert.AreEqual ("NestedComponentName", ((INestedSite)nestedComponent.Site).FullName, "#5");
		}