Initial commit
[mono.git] / mcs / class / referencesource / System / compmod / system / componentmodel / IContainer.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="IContainer.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>                                                                
5 //------------------------------------------------------------------------------
6
7 namespace System.ComponentModel {
8
9     /*
10      * A "container" is an object that logically contains zero or more child
11      * components.
12      *
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.
16      */
17     // Interfaces don't need to be serializable
18     /// <devdoc>
19     ///    <para>Provides
20     ///       functionality for containers. Containers are objects that logically contain zero or more components.</para>
21     /// </devdoc>
22     [System.Runtime.InteropServices.ComVisible(true)]
23     public interface IContainer : IDisposable {
24
25         // Adds a component to the container.
26         /// <devdoc>
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>
29         /// </devdoc>
30         void Add(IComponent component);
31
32         //  Adds a component to the container.
33         /// <devdoc>
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>
36         /// </devdoc>
37         void Add(IComponent component, String name);
38
39         // The components in the container.
40         /// <devdoc>
41         /// <para>Gets all the components in the <see cref='System.ComponentModel.IContainer'/>.</para>
42         /// </devdoc>
43         ComponentCollection Components {get;}
44
45         // Removes a component from the container.
46         /// <devdoc>
47         /// <para>Removes a component from the <see cref='System.ComponentModel.IContainer'/>.</para>
48         /// </devdoc>
49         void Remove(IComponent component);
50     }
51 }