public static ReadObjectInfo Create(Type objectType, string[] memberNames, Type[] memberTypes, ISurrogateSelector surrogateSelector, StreamingContext context, ObjectManager objectManager, SerializationObjectInfo serObjectInfoInit, IFormatterConverter converter, bool bSimpleAssembly)
        {
            ReadObjectInfo objectInfo = GetObjectInfo();

            objectInfo.Init(objectType, memberNames, memberTypes, surrogateSelector, context, objectManager, serObjectInfoInit, converter, bSimpleAssembly);
            return(objectInfo);
        }
 public ValueFixup(object memberObject, string memberName, ReadObjectInfo objectInfo)
 {
     this._valueFixupEnum = ValueFixupEnum.Member;
     this._memberObject   = memberObject;
     this._memberName     = memberName;
     this._objectInfo     = objectInfo;
 }
Example #3
0
 public ObjectMap(string objectName, string[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, object[] typeInformationA, int[] memberAssemIds, ObjectReader objectReader, int objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
 {
     this._isInitObjectInfo = true;
     this._objectName       = objectName;
     this._memberNames      = memberNames;
     this._binaryTypeEnumA  = binaryTypeEnumA;
     this._typeInformationA = typeInformationA;
     this._objectReader     = objectReader;
     this._objectId         = objectId;
     this._assemblyInfo     = assemblyInfo;
     if (assemblyInfo == null)
     {
         throw new SerializationException(RemotingResources.SerializationAssemblyNotFound.Format(objectName));
     }
     this._objectType  = objectReader.GetType(assemblyInfo, objectName);
     this._memberTypes = new Type[memberNames.Length];
     for (int i = 0; i < memberNames.Length; i++)
     {
         BinaryTypeConverter.TypeFromInfo(binaryTypeEnumA[i], typeInformationA[i], objectReader, (BinaryAssemblyInfo)assemIdToAssemblyTable[memberAssemIds[i]], out _, out _, out Type type, out _);
         this._memberTypes[i] = type;
     }
     this._objectInfo = objectReader.CreateReadObjectInfo(this._objectType, memberNames, null);
     if (!this._objectInfo.IsSi)
     {
         this._objectInfo.GetMemberTypes(memberNames, this._objectInfo.ObjectType);
     }
 }
 private void ParseObject(ParseRecord pr)
 {
     if (!this.fullDeserialization)
     {
         this.InitFullDeserialization();
     }
     if (pr.objectPositionEnum == ObjectPositionEnum.Top)
     {
         this.topId = pr.objectId;
     }
     if (pr.parseTypeEnum == ParseTypeEnum.Object)
     {
         this.stack.Push(pr);
     }
     if (pr.objectTypeEnum == ObjectTypeEnum.Array)
     {
         this.ParseArray(pr);
     }
     else if (pr.dtType == null)
     {
         pr.newObj = new TypeLoadExceptionHolder(pr.keyDt);
     }
     else if (object.ReferenceEquals(pr.dtType, Converter.s_typeofString))
     {
         if (pr.value != null)
         {
             pr.newObj = pr.value;
             if (pr.objectPositionEnum == ObjectPositionEnum.Top)
             {
                 this.TopObject = pr.newObj;
             }
             else
             {
                 this.stack.Pop();
                 this.RegisterObject(pr.newObj, pr, (ParseRecord)this.stack.Peek());
             }
         }
     }
     else
     {
         this.CheckSerializable(pr.dtType);
         pr.newObj = FormatterServices.GetUninitializedObject(pr.dtType);
         this.objectManager.RaiseOnDeserializingEvent(pr.newObj);
         if (pr.newObj == null)
         {
             throw new SerializationException(RemotingResources.SerializationTopObjectNotInstanciated.Format(pr.dtType));
         }
         if (pr.objectPositionEnum == ObjectPositionEnum.Top)
         {
             this.TopObject = pr.newObj;
         }
         if (pr.objectInfo == null)
         {
             pr.objectInfo = ReadObjectInfo.Create(pr.dtType, this.surrogates, this.context, this.objectManager, this.objectInfo, this.converter, this.isSimpleAssembly);
         }
     }
 }
Example #5
0
 public ObjectMap(string objectName, Type objectType, string[] memberNames, ObjectReader objectReader, int objectId, BinaryAssemblyInfo assemblyInfo)
 {
     this._isInitObjectInfo = true;
     this._objectName       = objectName;
     this._objectType       = objectType;
     this._memberNames      = memberNames;
     this._objectReader     = objectReader;
     this._objectId         = objectId;
     this._assemblyInfo     = assemblyInfo;
     this._objectInfo       = objectReader.CreateReadObjectInfo(objectType);
     this._memberTypes      = this._objectInfo.GetMemberTypes(memberNames, objectType);
     this._binaryTypeEnumA  = new BinaryTypeEnum[this._memberTypes.Length];
     this._typeInformationA = new object[this._memberTypes.Length];
     for (int i = 0; i < this._memberTypes.Length; i++)
     {
         this._binaryTypeEnumA[i]  = BinaryTypeConverter.GetParserBinaryTypeInfo(this._memberTypes[i], out object typeInformation);
         this._typeInformationA[i] = typeInformation;
     }
 }
 public void Init()
 {
     parseTypeEnum      = ParseTypeEnum.Empty;
     objectTypeEnum     = ObjectTypeEnum.Empty;
     arrayTypeEnum      = ArrayTypeEnum.Empty;
     memberTypeEnum     = MemberTypeEnum.Empty;
     memberValueEnum    = MemberValueEnum.Empty;
     objectPositionEnum = ObjectPositionEnum.Empty;
     name                   = null;
     value                  = null;
     keyDt                  = null;
     dtType                 = null;
     dtTypeCode             = PrimitiveTypeEnum.Invalid;
     objectId               = 0L;
     idRef                  = 0L;
     arrayElementTypeString = null;
     arrayElementType       = null;
     isArrayVariant         = false;
     arrayElementTypeCode   = PrimitiveTypeEnum.Invalid;
     rank                   = 0;
     lengthA                = null;
     lowerBoundA            = null;
     indexMap               = null;
     memberIndex            = 0;
     linearlength           = 0;
     rectangularMap         = null;
     isLowerBound           = false;
     isValueTypeFixup       = false;
     newObj                 = null;
     objectA                = null;
     primitiveArray         = null;
     objectInfo             = null;
     isRegistered           = false;
     memberData             = null;
     si = null;
     consecutiveNullArrayEntryCount = 0;
 }
 public ReadObjectInfo CreateReadObjectInfo(Type objectType, string[] memberNames, Type[] memberTypes)
 {
     return(ReadObjectInfo.Create(objectType, memberNames, memberTypes, this.surrogates, this.context, this.objectManager, this.objectInfo, this.converter, this.isSimpleAssembly));
 }
 public ReadObjectInfo CreateReadObjectInfo(Type objectType)
 {
     return(ReadObjectInfo.Create(objectType, this.surrogates, this.context, this.objectManager, this.objectInfo, this.converter, this.isSimpleAssembly));
 }