CreateReadObjectInfo() private method

private CreateReadObjectInfo ( Type objectType ) : ReadObjectInfo
objectType System.Type
return ReadObjectInfo
示例#1
0
        internal ObjectMap(
            string objectName,
            [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type objectType,
            string[] memberNames,
            ObjectReader objectReader,
            int objectId,
            BinaryAssemblyInfo assemblyInfo)
        {
            _objectName   = objectName;
            _objectType   = objectType;
            _memberNames  = memberNames;
            _objectReader = objectReader;
            _objectId     = objectId;
            _assemblyInfo = assemblyInfo;

            _objectInfo  = objectReader.CreateReadObjectInfo(objectType);
            _memberTypes = _objectInfo.GetMemberTypes(memberNames, objectType) !;

            _binaryTypeEnumA  = new BinaryTypeEnum[_memberTypes.Length];
            _typeInformationA = new object[_memberTypes.Length];

            for (int i = 0; i < _memberTypes.Length; i++)
            {
                BinaryTypeEnum binaryTypeEnum = BinaryTypeConverter.GetParserBinaryTypeInfo(_memberTypes[i] !, out object?typeInformation);
                _binaryTypeEnumA[i]  = binaryTypeEnum;
                _typeInformationA[i] = typeInformation;
            }
        }
示例#2
0
 internal 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(Environment.GetResourceString("Serialization_Assembly", new object[] { objectName }));
     }
     this.objectType  = objectReader.GetType(assemblyInfo, objectName);
     this.memberTypes = new Type[memberNames.Length];
     for (int i = 0; i < memberNames.Length; i++)
     {
         InternalPrimitiveTypeE ee;
         string str;
         Type   type;
         bool   flag;
         BinaryConverter.TypeFromInfo(binaryTypeEnumA[i], typeInformationA[i], objectReader, (BinaryAssemblyInfo)assemIdToAssemblyTable[memberAssemIds[i]], out ee, out str, out type, out flag);
         this.memberTypes[i] = type;
     }
     this.objectInfo = objectReader.CreateReadObjectInfo(this.objectType, memberNames, null);
     if (!this.objectInfo.isSi)
     {
         this.objectInfo.GetMemberTypes(memberNames, this.objectInfo.objectType);
     }
 }
示例#3
0
        internal ObjectMap(string objectName, string[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, object?[] typeInformationA, int[] memberAssemIds, ObjectReader objectReader, int objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
        {
            _objectName       = objectName;
            _memberNames      = memberNames;
            _binaryTypeEnumA  = binaryTypeEnumA;
            _typeInformationA = typeInformationA;
            _objectReader     = objectReader;
            _objectId         = objectId;
            _assemblyInfo     = assemblyInfo;

            if (assemblyInfo == null)
            {
                throw new SerializationException(SR.Format(SR.Serialization_Assembly, objectName));
            }

            _objectType  = objectReader.GetType(assemblyInfo, objectName);
            _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 _);
                _memberTypes[i] = type;
            }

            _objectInfo = objectReader.CreateReadObjectInfo(_objectType, memberNames, null);
            if (!_objectInfo._isSi)
            {
                _objectInfo.GetMemberTypes(memberNames, _objectInfo._objectType);  // Check version match
            }
        }
 internal 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(Environment.GetResourceString("Serialization_Assembly", new object[] { objectName }));
     }
     this.objectType = objectReader.GetType(assemblyInfo, objectName);
     this.memberTypes = new Type[memberNames.Length];
     for (int i = 0; i < memberNames.Length; i++)
     {
         InternalPrimitiveTypeE ee;
         string str;
         Type type;
         bool flag;
         BinaryConverter.TypeFromInfo(binaryTypeEnumA[i], typeInformationA[i], objectReader, (BinaryAssemblyInfo) assemIdToAssemblyTable[memberAssemIds[i]], out ee, out str, out type, out flag);
         this.memberTypes[i] = type;
     }
     this.objectInfo = objectReader.CreateReadObjectInfo(this.objectType, memberNames, null);
     if (!this.objectInfo.isSi)
     {
         this.objectInfo.GetMemberTypes(memberNames, this.objectInfo.objectType);
     }
 }
 internal ObjectMap(string objectName, string[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, object[] typeInformationA, int[] memberAssemIds, ObjectReader objectReader, int objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
 {
     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(Environment.GetResourceString("Serialization_Assembly", (object)objectName));
     }
     this.objectType  = objectReader.GetType(assemblyInfo, objectName);
     this.memberTypes = new Type[memberNames.Length];
     for (int index = 0; index < memberNames.Length; ++index)
     {
         InternalPrimitiveTypeE primitiveTypeEnum;
         string typeString;
         Type   type;
         bool   isVariant;
         BinaryConverter.TypeFromInfo(binaryTypeEnumA[index], typeInformationA[index], objectReader, (BinaryAssemblyInfo)assemIdToAssemblyTable[memberAssemIds[index]], out primitiveTypeEnum, out typeString, out type, out isVariant);
         this.memberTypes[index] = type;
     }
     this.objectInfo = objectReader.CreateReadObjectInfo(this.objectType, memberNames, (Type[])null);
     if (this.objectInfo.isSi)
     {
         return;
     }
     this.objectInfo.GetMemberTypes(memberNames, this.objectInfo.objectType);
 }
示例#6
0
 internal 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++)
     {
         object typeInformation = null;
         this.binaryTypeEnumA[i]  = BinaryConverter.GetParserBinaryTypeInfo(this.memberTypes[i], out typeInformation);
         this.typeInformationA[i] = typeInformation;
     }
 }
 internal 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++)
     {
         object typeInformation = null;
         this.binaryTypeEnumA[i] = BinaryConverter.GetParserBinaryTypeInfo(this.memberTypes[i], out typeInformation);
         this.typeInformationA[i] = typeInformation;
     }
 }
        [System.Security.SecurityCritical]  // auto-generated 
        internal ObjectMap(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, int[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
        {
            SerTrace.Log( this, "Constructor 2 objectName ",objectName);
            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(Environment.GetResourceString("Serialization_Assembly",objectName)); 

            objectType = objectReader.GetType(assemblyInfo, objectName); 
 
            memberTypes = new Type[memberNames.Length];
 
            for (int i=0; i<memberNames.Length; i++)
            {
                InternalPrimitiveTypeE primitiveTypeEnum;
                String typeString; 
                Type type;
                bool isVariant; 
 
                BinaryConverter.TypeFromInfo(binaryTypeEnumA[i], typeInformationA[i], objectReader, (BinaryAssemblyInfo)assemIdToAssemblyTable[memberAssemIds[i]],
                                             out primitiveTypeEnum, out typeString, out type, out isVariant); 
                //if ((object)type == null)
                //    throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_TypeResolved"),objectName+" "+memberNames[i]+" "+typeInformationA[i]));
                memberTypes[i] = type;
            } 

            objectInfo = objectReader.CreateReadObjectInfo(objectType, memberNames, null); 
            if (!objectInfo.isSi) 
                objectInfo.GetMemberTypes(memberNames, objectInfo.objectType);  // Check version match
        } 
        [System.Security.SecurityCritical]  // auto-generated
        internal ObjectMap(String objectName, Type objectType, String[] memberNames, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo)
        {
            SerTrace.Log( this, "Constructor 1 objectName ",objectName, ", objectType ",objectType); 
            this.objectName = objectName;
            this.objectType = objectType; 
            this.memberNames = memberNames; 
            this.objectReader = objectReader;
            this.objectId = objectId; 
            this.assemblyInfo = assemblyInfo;

            objectInfo = objectReader.CreateReadObjectInfo(objectType);
            memberTypes = objectInfo.GetMemberTypes(memberNames, objectType); 

            binaryTypeEnumA = new BinaryTypeEnum[memberTypes.Length]; 
            typeInformationA = new Object[memberTypes.Length]; 

            for (int i=0; i<memberTypes.Length; i++) 
            {
                Object typeInformation = null;
                BinaryTypeEnum binaryTypeEnum = BinaryConverter.GetParserBinaryTypeInfo(memberTypes[i], out typeInformation);
                binaryTypeEnumA[i] = binaryTypeEnum; 
                typeInformationA[i] = typeInformation;
            } 
        }