The Labs \ Source Viewer \ SSCLI \ System.Xml.Serialization.Configuration \ XmlSerializerSection

  1. //------------------------------------------------------------------------------
  2. // <copyright file="XmlSerializerSection.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. // <owner current="true" primary="true">ElenaK</owner>
  15. //------------------------------------------------------------------------------
  16. namespace System.Xml.Serialization.Configuration
  17. {
  18.     using System;
  19.     using System.Configuration;
  20.     using System.ComponentModel;
  21.     using System.Globalization;
  22.     using System.Reflection;
  23.    
  24.     public sealed class XmlSerializerSection : ConfigurationSection
  25.     {
  26.         public XmlSerializerSection()
  27.         {
  28.             this.properties.Add(this.checkDeserializeAdvances);
  29.         }
  30.        
  31.         protected override ConfigurationPropertyCollection Properties {
  32.             get { return this.properties; }
  33.         }
  34.        
  35.         [ConfigurationProperty(ConfigurationStrings.CheckDeserializeAdvances, DefaultValue = false)]
  36.         public bool CheckDeserializeAdvances {
  37.             get { return (bool)this[this.checkDeserializeAdvances]; }
  38.             set { this[this.checkDeserializeAdvances] = value; }
  39.         }
  40.        
  41.         ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
  42.        
  43.         // Supply a type converter, even though it's a plain type converter, to get around ConfigurationProperty's internal
  44.         // Enum conversion routine. The internal one is case-sensitive, we want this to be case-insensitive.
  45.         readonly ConfigurationProperty checkDeserializeAdvances = new ConfigurationProperty(ConfigurationStrings.CheckDeserializeAdvances, typeof(bool), false, ConfigurationPropertyOptions.None);
  46.        
  47.     }
  48.    
  49. }

Developer Fusion