The Labs \ Source Viewer \ SSCLI \ System.ComponentModel \ IContainer

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IContainer.cs" company="Microsoft">
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. // </copyright>
  14. //------------------------------------------------------------------------------
  15. namespace System.ComponentModel
  16. {
  17.    
  18. /*
  19.     * A "container" is an object that logically contains zero or more child
  20.     * components.
  21.     *
  22.     * In this context, "containment" refers to logical containment, not visual
  23.     * containment.  Components and containers can be used in a variety of
  24.     * scenarios, including both visual and non-visual scenarios.
  25.     */   
  26.     // Interfaces don't need to be serializable
  27.     /// <devdoc>
  28.     /// <para>Provides
  29.     /// functionality for containers. Containers are objects that logically contain zero or more components.</para>
  30.     /// </devdoc>
  31.     [System.Runtime.InteropServices.ComVisible(true)]
  32.     public interface IContainer : IDisposable
  33.     {
  34.        
  35.         // Adds a component to the container.
  36.         /// <devdoc>
  37.         /// <para>Adds the specified <see cref='System.ComponentModel.IComponent'/> to the <see cref='System.ComponentModel.IContainer'/>
  38.         /// at the end of the list.</para>
  39.         /// </devdoc>
  40.         void Add(IComponent component);
  41.        
  42.         // Adds a component to the container.
  43.         /// <devdoc>
  44.         /// <para>Adds the specified <see cref='System.ComponentModel.IComponent'/> to the <see cref='System.ComponentModel.IContainer'/>
  45.         /// at the end of the list, and assigns a name to the component.</para>
  46.         /// </devdoc>
  47.         void Add(IComponent component, string name);
  48.        
  49.         // The components in the container.
  50.         /// <devdoc>
  51.         /// <para>Gets all the components in the <see cref='System.ComponentModel.IContainer'/>.</para>
  52.         /// </devdoc>
  53.         ComponentCollection Components {
  54.             get;
  55.         }
  56.        
  57.         // Removes a component from the container.
  58.         /// <devdoc>
  59.         /// <para>Removes a component from the <see cref='System.ComponentModel.IContainer'/>.</para>
  60.         /// </devdoc>
  61.         void Remove(IComponent component);
  62.     }
  63. }

Developer Fusion