コード例 #1
0
        public object ReflectionReadClass(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context, XmlDictionaryString[] memberNames, XmlDictionaryString[] memberNamespaces, ClassDataContract classContract)
        {
            object obj = CreateObject(classContract);

            context.AddNewObject(obj);
            InvokeOnDeserializing(context, classContract, obj);

            if (classContract.IsISerializable)
            {
                obj = ReadISerializable(xmlReader, context, classContract);
            }
            else
            {
                ReflectionReadMembers(xmlReader, context, memberNames, memberNamespaces, classContract, ref obj);
            }

            if (obj is IObjectReference objectReference)
            {
                obj = context.GetRealObject(objectReference, context.GetObjectId());
            }

            obj = ResolveAdapterObject(obj, classContract);
            InvokeDeserializationCallback(obj);
            InvokeOnDeserialized(context, classContract, obj);

            return(obj);
        }
コード例 #2
0
 bool InvokeFactoryMethod(ClassDataContract classContract, string objectId)
 {
     if (HasFactoryMethod(classContract))
     {
         objectLocal = CodeInterpreter.ConvertValue(context.GetRealObject((IObjectReference)objectLocal, objectId), Globals.TypeOfObject, classContract.UnderlyingType);
         return(true);
     }
     return(false);
 }