Xamarin Public Jenkins (auto-signing) 536cd135cc Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
2017-08-21 15:34:15 +00:00

57 lines
2.1 KiB
C#

//------------------------------------------------------------------------------
// <copyright file="DateTimeSerializationSection.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">Microsoft</owner>
//------------------------------------------------------------------------------
#if CONFIGURATION_DEP
namespace System.Xml.Serialization.Configuration
{
using System;
using System.Configuration;
using System.ComponentModel;
using System.Globalization;
using System.Reflection;
public sealed class DateTimeSerializationSection : ConfigurationSection
{
public enum DateTimeSerializationMode
{
Default = 0,
Roundtrip = 1,
Local = 2,
}
public DateTimeSerializationSection()
{
this.properties.Add(this.mode);
}
protected override ConfigurationPropertyCollection Properties
{
get
{
return this.properties;
}
}
[ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue=DateTimeSerializationMode.Roundtrip)]
public DateTimeSerializationMode Mode
{
get { return (DateTimeSerializationMode) this[this.mode]; }
set { this[this.mode] = value; }
}
ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
// Supply a type converter, even though it's a plain type converter, to get around ConfigurationProperty's internal
// Enum conversion routine. The internal one is case-sensitive, we want this to be case-insensitive.
readonly ConfigurationProperty mode =
new ConfigurationProperty(ConfigurationStrings.Mode, typeof(DateTimeSerializationMode), DateTimeSerializationMode.Roundtrip,
new EnumConverter(typeof(DateTimeSerializationMode)), null, ConfigurationPropertyOptions.None);
}
}
#endif