The Labs \ Source Viewer \ SSCLI \ System.ComponentModel.Design.Serialization \ DesignerLoader

  1. //------------------------------------------------------------------------------
  2. // <copyright file="DesignerLoader.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.Design.Serialization
  16. {
  17.    
  18.     using System;
  19.     using System.Reflection;
  20.     using System.Security.Permissions;
  21.    
  22.     /// <devdoc>
  23.     /// DesignerLoader. This class is responsible for loading a designer document.
  24.     /// Where and how this load occurs is a private matter for the designer loader.
  25.     /// The designer loader will be handed to an IDesignerHost instance. This instance,
  26.     /// when it is ready to load the document, will call BeginLoad, passing an instance
  27.     /// of IDesignerLoaderHost. The designer loader will load up the design surface
  28.     /// using the host interface, and call EndLoad on the interface when it is done.
  29.     /// The error collection passed into EndLoad should be empty or null to indicate a
  30.     /// successful load, or it should contain a collection of exceptions that
  31.     /// describe the error.
  32.     ///
  33.     /// Once a document is loaded, the designer loader is also responsible for
  34.     /// writing any changes made to the document back whatever storage the
  35.     /// loader used when loading the document.
  36.     /// </devdoc>
  37.     [HostProtection(SharedState = true)]
  38.     [System.Security.Permissions.PermissionSetAttribute(System.Security.Permissions.SecurityAction.InheritanceDemand, Name = "FullTrust")]
  39.     [System.Runtime.InteropServices.ComVisible(true)]
  40.     public abstract class DesignerLoader
  41.     {
  42.        
  43.         /// <devdoc>
  44.         /// Returns true when the designer is in the process of loading. Clients that are
  45.         /// sinking notifications from the designer often want to ignore them while the desingner is loading
  46.         /// and only respond to them if they result from user interatcions.
  47.         /// </devdoc>
  48.         public virtual bool Loading {
  49.             get { return false; }
  50.         }
  51.        
  52.         /// <devdoc>
  53.         /// Called by the designer host to begin the loading process. The designer
  54.         /// host passes in an instance of a designer loader host (which is typically
  55.         /// the same object as the designer host. This loader host allows
  56.         /// the designer loader to reload the design document and also allows
  57.         /// the designer loader to indicate that it has finished loading the
  58.         /// design document.
  59.         /// </devdoc>
  60.         public abstract void BeginLoad(IDesignerLoaderHost host);
  61.        
  62.         /// <devdoc>
  63.         /// Disposes this designer loader. The designer host will call this method
  64.         /// when the design document itself is being destroyed. Once called, the
  65.         /// designer loader will never be called again.
  66.         /// </devdoc>
  67.         public abstract void Dispose();
  68.        
  69.         /// <devdoc>
  70.         /// The designer host will call this periodically when it wants to
  71.         /// ensure that any changes that have been made to the document
  72.         /// have been saved by the designer loader. This method allows
  73.         /// designer loaders to implement a lazy-write scheme to improve
  74.         /// performance. The default implementation does nothing.
  75.         /// </devdoc>
  76.         public virtual void Flush()
  77.         {
  78.         }
  79.     }
  80. }

Developer Fusion