diff options
author | Martin Baulig <martin.baulig@xamarin.com> | 2013-03-13 02:29:38 +0400 |
---|---|---|
committer | Martin Baulig <martin.baulig@xamarin.com> | 2013-03-13 05:15:56 +0400 |
commit | 54f7c82d2b1ef2bedbf90c262fda28654727a5c9 (patch) | |
tree | c5f2062711f21d044341bed8a0111a2cf2673a79 /mcs/class/System.ServiceModel.Web | |
parent | d54fac434918728df6fe556be9e6328826883026 (diff) |
DataContractSerializer changes for .NET 4.5.
* Move System.Runtime.Serialization.Json from System.ServiceModel.Web.dll
into System.Runtime.Serialization.dll on the mobile profile.
* Add DataContractJsonSerializerSettings and DataContractSerializerSettings..
Diffstat (limited to 'mcs/class/System.ServiceModel.Web')
3 files changed, 76 insertions, 10 deletions
diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs index e9e45c0f732..37a5b74981c 100644 --- a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs +++ b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializer.cs @@ -107,6 +107,14 @@ namespace System.Runtime.Serialization.Json { } +#if NET_4_5 + public DataContractJsonSerializer (Type type, DataContractJsonSerializerSettings settings) + : this (type, settings.RootName, settings.KnownTypes, settings.MaxItemsInObjectGraph, settings.IgnoreExtensionDataObject, + settings.DataContractSurrogate, false) + { + } +#endif + #endregion Type type; @@ -250,5 +258,28 @@ namespace System.Runtime.Serialization.Json throw new ArgumentNullException ("writer"); writer.WriteEndElement (); } + +#if NET_4_5 + [MonoTODO] + public DateTimeFormat DateTimeFormat { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public EmitTypeInformation EmitTypeInformation { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public bool SerializeReadOnlyTypes { + get { throw new NotImplementedException (); } + } + + [MonoTODO] + public bool UseSimpleDictionaryFormat { + get { throw new NotImplementedException (); } + } +#endif + } } diff --git a/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializerSettings.cs b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializerSettings.cs new file mode 100644 index 00000000000..7e16d85cf5a --- /dev/null +++ b/mcs/class/System.ServiceModel.Web/System.Runtime.Serialization.Json/DataContractJsonSerializerSettings.cs @@ -0,0 +1,45 @@ +// +// DataContractJsonSerializerSettings.cs +// +// Author: +// Martin Baulig <martin.baulig@xamarin.com> +// +// Copyright (c) 2013 Xamarin Inc. (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +using System; +using System.Xml; +using System.Collections.Generic; + +namespace System.Runtime.Serialization.Json +{ + public class DataContractJsonSerializerSettings + { + public IDataContractSurrogate DataContractSurrogate { get; set; } + public DateTimeFormat DateTimeFormat { get; set; } + public EmitTypeInformation EmitTypeInformation { get; set; } + public bool IgnoreExtensionDataObject { get; set; } + public IEnumerable<Type> KnownTypes { get; set; } + public int MaxItemsInObjectGraph { get; set; } + public string RootName { get; set; } + public bool SerializeReadOnlyTypes { get; set; } + public bool UseSimpleDictionaryFormat { get; set; } + } +} + diff --git a/mcs/class/System.ServiceModel.Web/mobile_System.ServiceModel.Web.dll.sources b/mcs/class/System.ServiceModel.Web/mobile_System.ServiceModel.Web.dll.sources index ca20192c5d3..b419528d712 100644 --- a/mcs/class/System.ServiceModel.Web/mobile_System.ServiceModel.Web.dll.sources +++ b/mcs/class/System.ServiceModel.Web/mobile_System.ServiceModel.Web.dll.sources @@ -1,14 +1,4 @@ Assembly/AssemblyInfo.cs -System.Runtime.Serialization.Json/DataContractJsonSerializer.cs -System.Runtime.Serialization.Json/IXmlJsonReaderInitializer.cs -System.Runtime.Serialization.Json/IXmlJsonWriterInitializer.cs -System.Runtime.Serialization.Json/JavaScriptReader.cs -System.Runtime.Serialization.Json/JsonReader.cs -System.Runtime.Serialization.Json/JsonReaderWriterFactory.cs -System.Runtime.Serialization.Json/JsonSerializationReader.cs -System.Runtime.Serialization.Json/JsonSerializationWriter.cs -System.Runtime.Serialization.Json/JsonWriter.cs -System.Runtime.Serialization.Json/TypeMap.cs System.ServiceModel.Channels/WebBodyFormatMessageProperty.cs System.ServiceModel.Channels/WebContentFormat.cs System.ServiceModel.Channels/WebContentTypeMapper.cs |