Esempio n. 1
0
        /// <summary>Deserializes an object from intermediate XML format.</summary>
        /// <param name="input">Location of the intermediate XML and various deserialization helpers.</param>
        /// <param name="format">Specifies the intermediate source XML format.</param>
        /// <param name="existingInstance">The object containing the received data, or null if the deserializer should construct a new instance.</param>
        protected internal override object Deserialize(IntermediateReader input, ContentSerializerAttribute format, object existingInstance)
        {
            T existingInstance2;

            if (existingInstance == null)
            {
                existingInstance2 = default(T);
            }
            else
            {
                existingInstance2 = ContentTypeSerializer <T> .CastType(existingInstance);
            }
            return(this.Deserialize(input, format, existingInstance2));
        }
Esempio n. 2
0
 /// <summary>Examines the children of the specified object, passing each to a callback delegate.</summary>
 /// <param name="serializer">The content serializer.</param>
 /// <param name="callback">The method to be called for each examined child.</param>
 /// <param name="value">The object whose children are being scanned.</param>
 protected internal override void ScanChildren(IntermediateSerializer serializer, ContentTypeSerializer.ChildCallback callback, object value)
 {
     this.ScanChildren(serializer, callback, ContentTypeSerializer <T> .CastType(value));
 }
Esempio n. 3
0
 /// <summary>Queries whether a strongly-typed object contains data to be serialized.</summary>
 /// <param name="value">The object to query.</param>
 public override bool ObjectIsEmpty(object value)
 {
     return(this.ObjectIsEmpty(ContentTypeSerializer <T> .CastType(value)));
 }
Esempio n. 4
0
 /// <summary>Serializes an object to intermediate XML format.</summary>
 /// <param name="output">Specifies the intermediate XML location, and provides various serialization helpers.</param>
 /// <param name="value">The object to be serialized.</param>
 /// <param name="format">Specifies the content format for this object.</param>
 protected internal override void Serialize(IntermediateWriter output, object value, ContentSerializerAttribute format)
 {
     this.Serialize(output, ContentTypeSerializer <T> .CastType(value), format);
 }