1 //------------------------------------------------------------------------------
2 // <copyright file="IContainer.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //------------------------------------------------------------------------------
7 namespace System.ComponentModel {
10 * A "container" is an object that logically contains zero or more child
13 * In this context, "containment" refers to logical containment, not visual
14 * containment. Components and containers can be used in a variety of
15 * scenarios, including both visual and non-visual scenarios.
17 // Interfaces don't need to be serializable
20 /// functionality for containers. Containers are objects that logically contain zero or more components.</para>
22 [System.Runtime.InteropServices.ComVisible(true)]
23 public interface IContainer : IDisposable {
25 // Adds a component to the container.
27 /// <para>Adds the specified <see cref='System.ComponentModel.IComponent'/> to the <see cref='System.ComponentModel.IContainer'/>
28 /// at the end of the list.</para>
30 void Add(IComponent component);
32 // Adds a component to the container.
34 /// <para>Adds the specified <see cref='System.ComponentModel.IComponent'/> to the <see cref='System.ComponentModel.IContainer'/>
35 /// at the end of the list, and assigns a name to the component.</para>
37 void Add(IComponent component, String name);
39 // The components in the container.
41 /// <para>Gets all the components in the <see cref='System.ComponentModel.IContainer'/>.</para>
43 ComponentCollection Components {get;}
45 // Removes a component from the container.
47 /// <para>Removes a component from the <see cref='System.ComponentModel.IContainer'/>.</para>
49 void Remove(IComponent component);