void ReadISerializable(ClassDataContract classContract)
        {
            ConstructorInfo ctor = classContract.GetISerializableConstructor();
            var             info = context.ReadSerializationInfo(xmlReader, classContract.UnderlyingType);

            ctor.Invoke(objectLocal, new object [] { info, context.GetStreamingContext() });
        }
示例#2
0
        private static object ReadISerializable(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, ClassDataContract classContract)
        {
            object            obj;
            SerializationInfo serializationInfo        = context.ReadSerializationInfo(xmlReader, classContract.UnderlyingType);
            StreamingContext  streamingContext         = context.GetStreamingContext();
            ConstructorInfo   iSerializableConstructor = classContract.GetISerializableConstructor();

            obj = iSerializableConstructor.Invoke(new object[] { serializationInfo, streamingContext });
            return(obj);
        }
 private void ReadISerializable(ClassDataContract classContract)
 {
     ConstructorInfo ctor = classContract.GetISerializableConstructor();
     _ilg.LoadAddress(_objectLocal);
     _ilg.ConvertAddress(_objectLocal.LocalType, _objectType);
     _ilg.Call(_contextArg, XmlFormatGeneratorStatics.ReadSerializationInfoMethod, _xmlReaderArg, classContract.UnderlyingType);
     _ilg.Load(_contextArg);
     _ilg.LoadMember(XmlFormatGeneratorStatics.GetStreamingContextMethod);
     _ilg.Call(ctor);
 }
 void ReadISerializable(ClassDataContract classContract)
 {
     ConstructorInfo ctor = classContract.GetISerializableConstructor();
     ilg.LoadAddress(objectLocal);
     ilg.ConvertAddress(objectLocal.LocalType, objectType);
     ilg.Call(contextArg, XmlFormatGeneratorStatics.ReadSerializationInfoMethod, xmlReaderArg, classContract.UnderlyingType);
     ilg.Load(contextArg);
     ilg.LoadMember(XmlFormatGeneratorStatics.GetStreamingContextMethod);
     ilg.Call(ctor);
 }
		void ReadISerializable (ClassDataContract classContract)
		{
			ConstructorInfo ctor = classContract.GetISerializableConstructor ();
			context.ReadSerializationInfo (xmlReader, classContract.UnderlyingType);
			ctor.Invoke (objectLocal, new object [] {context.GetStreamingContext ()});
		}