| 1234567891011121314151617181920212223242526272829303132 |
- //----------------------------------------------------------------
- // Copyright (c) Microsoft Corporation. All rights reserved.
- //----------------------------------------------------------------
- namespace System.Runtime.Serialization.Json
- {
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Diagnostics;
- using System.Xml;
- class JsonStringDataContract : JsonDataContract
- {
- public JsonStringDataContract(StringDataContract traditionalStringDataContract)
- : base(traditionalStringDataContract)
- {
- }
- public override object ReadJsonValueCore(XmlReaderDelegator jsonReader, XmlObjectSerializerReadContextComplexJson context)
- {
- if (context == null)
- {
- return TryReadNullAtTopLevel(jsonReader) ? null : jsonReader.ReadElementContentAsString();
- }
- else
- {
- return HandleReadValue(jsonReader.ReadElementContentAsString(), context);
- }
- }
- }
- }
|