The Labs \ Source Viewer \ SSCLI \ System.ComponentModel.Design \ IDesignerHost

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IDesignerHost.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. /*
  16. */
  17. namespace System.ComponentModel.Design
  18. {
  19.     using System.Diagnostics;
  20.     using System;
  21.     using System.ComponentModel;
  22.     using Microsoft.Win32;
  23.     using System.Reflection;
  24.    
  25.     /// <devdoc>
  26.     /// <para>
  27.     /// Provides methods to adjust the configuration of and retrieve
  28.     /// information about the services and behavior of a designer.
  29.     /// </para>
  30.     /// </devdoc>
  31.     [System.Runtime.InteropServices.ComVisible(true)]
  32.     public interface IDesignerHost : IServiceContainer
  33.     {
  34.        
  35.         /// <devdoc>
  36.         /// <para>
  37.         /// Gets or sets a value indicating whether the designer host
  38.         /// is currently loading the document.
  39.         /// </para>
  40.         /// </devdoc>
  41.         bool Loading {
  42.             get;
  43.         }
  44.        
  45.         /// <devdoc>
  46.         /// <para>Gets a value indicating whether the designer host is currently in a transaction.</para>
  47.         /// </devdoc>
  48.         bool InTransaction {
  49.             get;
  50.         }
  51.        
  52.         /// <devdoc>
  53.         /// <para>
  54.         /// Gets the container for this designer host.
  55.         /// </para>
  56.         /// </devdoc>
  57.         IContainer Container {
  58.             get;
  59.         }
  60.        
  61.         /// <devdoc>
  62.         /// <para>
  63.         /// Gets the instance of the base class used as the base class for the current design.
  64.         /// </para>
  65.         /// </devdoc>
  66.         IComponent RootComponent {
  67.             get;
  68.         }
  69.        
  70.         /// <devdoc>
  71.         /// <para>
  72.         /// Gets the fully qualified name of the class that is being designed.
  73.         /// </para>
  74.         /// </devdoc>
  75.         string RootComponentClassName {
  76.             get;
  77.         }
  78.        
  79.         /// <devdoc>
  80.         /// <para>
  81.         /// Gets the description of the current transaction.
  82.         /// </para>
  83.         /// </devdoc>
  84.         string TransactionDescription {
  85.             get;
  86.         }
  87.        
  88.         /// <devdoc>
  89.         /// <para>
  90.         /// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.Activated'/> event.
  91.         /// </para>
  92.         /// </devdoc>
  93.         event EventHandler Activated;
  94.        
  95.         /// <devdoc>
  96.         /// <para>
  97.         /// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.Deactivated'/> event.
  98.         /// </para>
  99.         /// </devdoc>
  100.         event EventHandler Deactivated;
  101.        
  102.         /// <devdoc>
  103.         /// <para>
  104.         /// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.LoadComplete'/> event.
  105.         /// </para>
  106.         /// </devdoc>
  107.         event EventHandler LoadComplete;
  108.        
  109.         /// <devdoc>
  110.         /// <para>
  111.         /// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionClosed'/> event.
  112.         /// </para>
  113.         /// </devdoc>
  114.         event DesignerTransactionCloseEventHandler TransactionClosed;
  115.        
  116.         /// <devdoc>
  117.         /// <para>Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionClosing'/> event.</para>
  118.         /// </devdoc>
  119.         event DesignerTransactionCloseEventHandler TransactionClosing;
  120.        
  121.         /// <devdoc>
  122.         /// <para>Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionOpened'/> event.</para>
  123.         /// </devdoc>
  124.         event EventHandler TransactionOpened;
  125.        
  126.         /// <devdoc>
  127.         /// <para>
  128.         /// Adds an event handler for the <see cref='System.ComponentModel.Design.IDesignerHost.TransactionOpening'/> event.
  129.         /// </para>
  130.         /// </devdoc>
  131.         event EventHandler TransactionOpening;
  132.        
  133.         /// <devdoc>
  134.         /// <para>
  135.         /// Activates the designer that this host is hosting.
  136.         /// </para>
  137.         /// </devdoc>
  138.         void Activate();
  139.        
  140.         /// <devdoc>
  141.         /// <para>
  142.         /// Creates a component of the specified class type.
  143.         /// </para>
  144.         /// </devdoc>
  145.         IComponent CreateComponent(Type componentClass);
  146.        
  147.         /// <devdoc>
  148.         /// <para>
  149.         /// Creates a component of the given class type and name and places it into the designer container.
  150.         /// </para>
  151.         /// </devdoc>
  152.         IComponent CreateComponent(Type componentClass, string name);
  153.        
  154.         /// <devdoc>
  155.         /// <para>
  156.         /// Lengthy operations that involve multiple components may raise many events. These events
  157.         /// may cause other side-effects, such as flicker or performance degradation. When operating
  158.         /// on multiple components at one time, or setting multiple properties on a single component,
  159.         /// you should encompass these changes inside a transaction. Transactions are used
  160.         /// to improve performance and reduce flicker. Slow operations can listen to
  161.         /// transaction events and only do work when the transaction completes.
  162.         /// </para>
  163.         /// </devdoc>
  164.         DesignerTransaction CreateTransaction();
  165.        
  166.         /// <devdoc>
  167.         /// <para>
  168.         /// Lengthy operations that involve multiple components may raise many events. These events
  169.         /// may cause other side-effects, such as flicker or performance degradation. When operating
  170.         /// on multiple components at one time, or setting multiple properties on a single component,
  171.         /// you should encompass these changes inside a transaction. Transactions are used
  172.         /// to improve performance and reduce flicker. Slow operations can listen to
  173.         /// transaction events and only do work when the transaction completes.
  174.         /// </para>
  175.         /// </devdoc>
  176.         DesignerTransaction CreateTransaction(string description);
  177.        
  178.         /// <devdoc>
  179.         /// <para>
  180.         /// Destroys the given component, removing it from the design container.
  181.         /// </para>
  182.         /// </devdoc>
  183.         void DestroyComponent(IComponent component);
  184.        
  185.         /// <devdoc>
  186.         /// <para>
  187.         /// Gets the designer instance for the specified component.
  188.         /// </para>
  189.         /// </devdoc>
  190.         IDesigner GetDesigner(IComponent component);
  191.        
  192.         /// <devdoc>
  193.         /// <para>
  194.         /// Gets the type instance for the specified fully qualified type name <paramref name="TypeName"/>.
  195.         /// </para>
  196.         /// </devdoc>
  197.         Type GetType(string typeName);
  198.     }
  199. }

Developer Fusion