Ejemplo n.º 1
0
        public override void WriteXmlValue(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context)
        {
            SerializationInfo serInfo = new SerializationInfo(UnderlyingType, XmlObjectSerializer.FormatterConverter, !context.UnsafeTypeForwardingEnabled);

            SerializationSurrogateGetObjectData(obj, serInfo, context.GetStreamingContext());
            context.WriteSerializationInfo(xmlWriter, UnderlyingType, serInfo);
        }
Ejemplo n.º 2
0
        public override void WriteXmlValue(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context)
        {
            SerializationInfo serInfo = new SerializationInfo(base.UnderlyingType, XmlObjectSerializer.FormatterConverter);

            this.SerializationSurrogateGetObjectData(obj, serInfo, context.GetStreamingContext());
            context.WriteSerializationInfo(xmlWriter, base.UnderlyingType, serInfo);
        }
 void InvokeOnSerialized(ClassDataContract classContract, object objSerialized, XmlObjectSerializerWriteContext ctx)
 {
     if (classContract.BaseContract != null)
     {
         InvokeOnSerialized(classContract.BaseContract, objSerialized, ctx);
     }
     if (classContract.OnSerialized != null)
     {
         classContract.OnSerialized.Invoke(objSerialized, new object [] { ctx.GetStreamingContext() });
     }
 }
Ejemplo n.º 4
0
 private void InvokeOnSerialized(object obj, XmlObjectSerializerWriteContext context, ClassDataContract classContract)
 {
     if (classContract.BaseClassContract != null)
     {
         InvokeOnSerialized(obj, context, classContract.BaseClassContract);
     }
     if (classContract.OnSerialized != null)
     {
         var contextArg = context.GetStreamingContext();
         classContract.OnSerialized.Invoke(obj, new object[] { contextArg });
     }
 }