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

  1. //------------------------------------------------------------------------------
  2. // <copyright file="BypassElement.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 BypassElement : ConfigurationElement
  23.     {
  24.         public BypassElement()
  25.         {
  26.             this.properties.Add(this.address);
  27.         }
  28.        
  29.         public BypassElement(string address) : this()
  30.         {
  31.             this.Address = address;
  32.         }
  33.        
  34.         protected override ConfigurationPropertyCollection Properties {
  35.             get { return this.properties; }
  36.         }
  37.        
  38.         [ConfigurationProperty(ConfigurationStrings.Address, IsRequired = true, IsKey = true)]
  39.         public string Address {
  40.             get { return (string)this[this.address]; }
  41.             set { this[this.address] = value; }
  42.         }
  43.        
  44.         internal string Key {
  45.             get { return this.Address; }
  46.         }
  47.        
  48.         ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
  49.        
  50.         readonly ConfigurationProperty address = new ConfigurationProperty(ConfigurationStrings.Address, typeof(string), null, ConfigurationPropertyOptions.IsKey);
  51.        
  52.     }
  53. }

Developer Fusion