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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IComponent.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.     using System;
  18.     using System.ComponentModel.Design;
  19.     using System.ComponentModel.Design.Serialization;
  20.    
  21. /*
  22.     * A "component" is an object that can be placed in a container.
  23.     *
  24.     * In this context, "containment" refers to logical containment, not visual
  25.     * containment.  Components and containers can be used in a variety of
  26.     * scenarios, including both visual and non-visual scenarios.
  27.     *
  28.     * To be a component, a class implements the IComponent interface, and provides
  29.     * a parameter-less constructor.
  30.     *
  31.     * A component interacts with its container primarily through a container-
  32.     * provided "site".
  33.     */   
  34.    
  35.     // Interfaces don't need to be serializable
  36.     /// <devdoc>
  37.     /// <para>Provides functionality required by all components.</para>
  38.     /// </devdoc>
  39.         #pragma warning disable 0618
  40.         #pragma warning restore 0618
  41.     [RootDesignerSerializer("System.ComponentModel.Design.Serialization.RootCodeDomSerializer, " + AssemblyRef.SystemDesign, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + AssemblyRef.SystemDesign, true), Designer("System.ComponentModel.Design.ComponentDesigner, " + AssemblyRef.SystemDesign, typeof(IDesigner)), Designer("System.Windows.Forms.Design.ComponentDocumentDesigner, " + AssemblyRef.SystemDesign, typeof(IRootDesigner)), TypeConverter(typeof(ComponentConverter)), System.Runtime.InteropServices.ComVisible(true)]
  42.     public interface IComponent : IDisposable
  43.     {
  44.        
  45.         // The site of the component.
  46.         /// <devdoc>
  47.         /// <para>When implemented by a class, gets or sets
  48.         /// the <see cref='System.ComponentModel.ISite'/> associated
  49.         /// with the <see cref='System.ComponentModel.IComponent'/>.</para>
  50.         /// </devdoc>
  51.         ISite Site {
  52.             get;
  53.             set;
  54.         }
  55.        
  56.         /// <devdoc>
  57.         /// <para>Adds a event handler to listen to the Disposed event on the component.</para>
  58.         /// </devdoc>
  59.         event EventHandler Disposed;
  60.     }
  61. }

Developer Fusion