﻿// Decompiled with JetBrains decompiler
// Type: System.Xml.Serialization.Configuration.DateTimeSerializationSection
// Assembly: System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
// MVID: 50ABAB51-7DC3-4F0A-A797-0D0C2D124D60
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Xml.dll

using System.ComponentModel;
using System.Configuration;
using System.Runtime;

namespace System.Xml.Serialization.Configuration
{
  /// <summary>
  /// Handles configuration settings for XML serialization of <see cref="T:System.DateTime"/> instances.
  /// </summary>
  public sealed class DateTimeSerializationSection : ConfigurationSection
  {
    private ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
    private readonly ConfigurationProperty mode = new ConfigurationProperty("mode", typeof (DateTimeSerializationSection.DateTimeSerializationMode), (object) DateTimeSerializationSection.DateTimeSerializationMode.Roundtrip, (TypeConverter) new EnumConverter(typeof (DateTimeSerializationSection.DateTimeSerializationMode)), (ConfigurationValidatorBase) null, ConfigurationPropertyOptions.None);

    protected override ConfigurationPropertyCollection Properties
    {
      [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] get
      {
        return this.properties;
      }
    }

    /// <summary>
    /// Gets or sets a value that determines the serialization format.
    /// </summary>
    /// 
    /// <returns>
    /// One of the <see cref="T:System.Xml.Serialization.Configuration.DateTimeSerializationSection.DateTimeSerializationMode"/> values.
    /// </returns>
    [ConfigurationProperty("mode", DefaultValue = DateTimeSerializationSection.DateTimeSerializationMode.Roundtrip)]
    public DateTimeSerializationSection.DateTimeSerializationMode Mode
    {
      get
      {
        return (DateTimeSerializationSection.DateTimeSerializationMode) this[this.mode];
      }
      set
      {
        this[this.mode] = (object) value;
      }
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="T:System.Xml.Serialization.Configuration.DateTimeSerializationSection"/> class.
    /// </summary>
    public DateTimeSerializationSection()
    {
      this.properties.Add(this.mode);
    }

    /// <summary>
    /// Determines XML serialization format of <see cref="T:System.DateTime"/> objects.
    /// </summary>
    public enum DateTimeSerializationMode
    {
      Default,
      Roundtrip,
      Local,
    }
  }
}
