Exemple #1
0
        public void WriteTextContent(TextContentAttribute attribute, object writer,
                                     object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            var current = serializerData.Convert <XElement>();

            current.Value = ObjectUtil.ToString(info.Converter, value, settings);
        }
        public void WriteTextContent(TextContentAttribute attribute, object writer,
                                     object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            XmlWriter xmlWriter = writer.Convert <XmlWriter>();

            xmlWriter.WriteString(ObjectUtil.ToString(info.Converter, value, settings));
        }
Exemple #3
0
        public void WriteTextContent(TextContentAttribute attribute, object writer,
                                     object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            JsonWriter jsonWriter = writer.Convert <JsonWriter>();

            jsonWriter.WritePropertyName(CONTENT_NAME);
            WriteSimpleJsonValue(jsonWriter, value, settings, info, attribute.UseSourceType);
        }
Exemple #4
0
        public void ReadTextContent(TextContentAttribute attribute, object reader,
                                    object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            object value = ReadSimpleValue(reader, receiver, settings, info, attribute.AutoTrim);

            SerializerUtil.CheckRequiredContent(attribute, receiver, info,
                                                value.ConvertToString());
        }
Exemple #5
0
        public void ReadTextContent(TextContentAttribute attribute, object reader,
                                    object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            XElement current = XElementData.GetCurrent(reader);

            string value = current.Value;

            SerializerUtil.CheckRequiredContent(attribute, receiver, info, value);
            SerializerUtil.SetObjectValue(receiver, settings, info, value, attribute.AutoTrim);
        }
        public void ReadTextContent(TextContentAttribute attribute, object reader,
                                    object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
        {
            XmlReader xml = reader.Convert <XmlReader>();

            string value = ReadString(xml);

            SerializerUtil.CheckRequiredContent(attribute, receiver, info, value);
            SerializerUtil.SetObjectValue(receiver, settings, info, value, attribute.AutoTrim);
        }
Exemple #7
0
 public void ReadTextContent(TextContentAttribute attribute, object reader,
                             object receiver, ReadSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     throw new NotSupportedException();
 }
Exemple #8
0
 public void WriteTextContent(TextContentAttribute attribute, object writer,
                              object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     throw new NotImplementedException();
 }
 public void WriteTextContent(TextContentAttribute attribute, object writer,
                              object value, WriteSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     SetValue(writer, info, ObjectInfo.CONTENT_NAME, value, settings);
 }
Exemple #10
0
 public void ReadTextContent(TextContentAttribute attribute, object reader, object receiver,
                             ReadSettings settings, ObjectPropertyInfo info, object serializerData)
 {
     SerializerUtil.SetObjectValue(receiver, settings, info,
                                   GetValue(reader, ObjectInfo.CONTENT_NAME), attribute.AutoTrim);
 }