The Labs \ Source Viewer \ SSCLI \ System.Net.Configuration \ PerformanceCountersElement

  1. //------------------------------------------------------------------------------
  2. // <copyright file="PerformanceCountersElement.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. namespace System.Net.Configuration
  16. {
  17.     using System;
  18.     using System.Configuration;
  19.     using System.Reflection;
  20.     using System.Security.Permissions;
  21.    
  22.     public sealed class PerformanceCountersElement : ConfigurationElement
  23.     {
  24.         public PerformanceCountersElement()
  25.         {
  26.             this.properties.Add(this.enabled);
  27.         }
  28.        
  29.         [ConfigurationProperty(ConfigurationStrings.Enabled, DefaultValue = false)]
  30.         public bool Enabled {
  31.             get { return (bool)this[this.enabled]; }
  32.             set { this[this.enabled] = value; }
  33.         }
  34.        
  35.         protected override ConfigurationPropertyCollection Properties {
  36.             get { return this.properties; }
  37.         }
  38.        
  39.         ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
  40.        
  41.         readonly ConfigurationProperty enabled = new ConfigurationProperty(ConfigurationStrings.Enabled, typeof(bool), false, ConfigurationPropertyOptions.None);
  42.     }
  43. }

Developer Fusion