The Labs \ Source Viewer \ SSCLI \ System.Configuration \ IPersistComponentSettings

  1. //------------------------------------------------------------------------------
  2. // <copyright file="IPersistComponentSettings.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.Configuration
  16. {
  17.     /// <devdoc>
  18.     /// Components should implement this interface if they want to persist custom settings
  19.     /// in a hosting application. This interface allows the application author to tell a control
  20.     /// whether to persist, when to load, save etc.
  21.     /// </devdoc>
  22.     public interface IPersistComponentSettings
  23.     {
  24.        
  25.         /// <devdoc>
  26.         /// Indicates to the implementor that settings should be persisted.
  27.         /// </devdoc>
  28.         bool SaveSettings {
  29.             get;
  30.             set;
  31.         }
  32.        
  33.         /// <devdoc>
  34.         /// Unique key that identifies an individual instance of a settings group(s). This key is needed
  35.         /// to identify which instance of a component owns a given group(s) of settings. Usually, the component
  36.         /// will frame its own key, but this property allows the hosting application to override it if necessary.
  37.         /// </devdoc>
  38.         string SettingsKey {
  39.             get;
  40.             set;
  41.         }
  42.        
  43.         /// <devdoc>
  44.         /// Tells the component to load its settings.
  45.         /// </devdoc>
  46.         void LoadComponentSettings();
  47.        
  48.         /// <devdoc>
  49.         /// Tells the component to save its settings.
  50.         /// </devdoc>
  51.         void SaveComponentSettings();
  52.        
  53.         /// <devdoc>
  54.         /// Tells the component to reset its settings. Typically, the component can call Reset on its settings class(es).
  55.         /// </devdoc>
  56.         void ResetComponentSettings();
  57.     }
  58. }

Developer Fusion