The Labs \ Source Viewer \ SSCLI \ System.Diagnostics \ AssertSection

  1. //------------------------------------------------------------------------------
  2. // <copyright file="AssertSection.cs" company="Microsoft Corporation">
  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. using System.Configuration;
  16. namespace System.Diagnostics
  17. {
  18.     internal class AssertSection : ConfigurationElement
  19.     {
  20.         private static readonly ConfigurationPropertyCollection _properties;
  21.         private static readonly ConfigurationProperty _propAssertUIEnabled = new ConfigurationProperty("assertuienabled", typeof(bool), true, ConfigurationPropertyOptions.None);
  22.         private static readonly ConfigurationProperty _propLogFile = new ConfigurationProperty("logfilename", typeof(string), String.Empty, ConfigurationPropertyOptions.None);
  23.        
  24.         static AssertSection()
  25.         {
  26.             _properties = new ConfigurationPropertyCollection();
  27.             _properties.Add(_propAssertUIEnabled);
  28.             _properties.Add(_propLogFile);
  29.         }
  30.        
  31.         [ConfigurationProperty("assertuienabled", DefaultValue = true)]
  32.         public bool AssertUIEnabled {
  33.             get { return (bool)this[_propAssertUIEnabled]; }
  34.         }
  35.        
  36.         [ConfigurationProperty("logfilename", DefaultValue = "")]
  37.         public string LogFileName {
  38.             get { return (string)this[_propLogFile]; }
  39.         }
  40.        
  41.         protected override ConfigurationPropertyCollection Properties {
  42.             get { return _properties; }
  43.         }
  44.        
  45.     }
  46. }

Developer Fusion