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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="ISite.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.     using System;
  19. /*
  20.     * Containers use sites to manage and communicate their child components.
  21.     *
  22.     * A site is a convenient place for a container to store container-specific
  23.     * per-component information.  The canonical example of such a piece of
  24.     * information is the name of the component.
  25.     *
  26.     * To be a site, a class implements the ISite interface.
  27.     */   
  28.     // Interfaces don't need to be serializable
  29.     /// <devdoc>
  30.     /// <para>Provides functionality required by sites. Sites bind
  31.     /// a <see cref='System.ComponentModel.Component'/> to a <see cref='System.ComponentModel.Container'/>
  32.     /// and enable communication between them, as well as provide a way
  33.     /// for the container to manage its components.</para>
  34.     /// </devdoc>
  35.     [System.Runtime.InteropServices.ComVisible(true)]
  36.     public interface ISite : IServiceProvider
  37.     {
  38.        
  39.         // The component sited by this component site.
  40.         /// <devdoc>
  41.         /// <para>When implemented by a class, gets the component associated with the <see cref='System.ComponentModel.ISite'/>.</para>
  42.         /// </devdoc>
  43.         IComponent Component {
  44.             get;
  45.         }
  46.        
  47.         // The container in which the component is sited.
  48.         /// <devdoc>
  49.         /// <para>When implemented by a class, gets the container associated with the <see cref='System.ComponentModel.ISite'/>.</para>
  50.         /// </devdoc>
  51.         IContainer Container {
  52.             get;
  53.         }
  54.        
  55.         // Indicates whether the component is in design mode.
  56.         /// <devdoc>
  57.         /// <para>When implemented by a class, determines whether the component is in design mode.</para>
  58.         /// </devdoc>
  59.         bool DesignMode {
  60.             get;
  61.         }
  62.        
  63.         // The name of the component.
  64.         //
  65.         /// <devdoc>
  66.         /// <para>When implemented by a class, gets or sets the name of
  67.         /// the component associated with the <see cref='System.ComponentModel.ISite'/>.</para>
  68.         /// </devdoc>
  69.         string Name {
  70.             get;
  71.             set;
  72.         }
  73.     }
  74. }

Developer Fusion