Exemple #1
0
        internal ObjectMap(string objectName, 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++)
            {
                object         typeInformation = null;
                BinaryTypeEnum binaryTypeEnum  = BinaryTypeConverter.GetParserBinaryTypeInfo(_memberTypes[i], out typeInformation);
                _binaryTypeEnumA[i]  = binaryTypeEnum;
                _typeInformationA[i] = typeInformation;
            }
        }
Exemple #2
0
        internal ObjectMap(string objectName, 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++)
            {
                object typeInformation = null;
                BinaryTypeEnum binaryTypeEnum = BinaryTypeConverter.GetParserBinaryTypeInfo(_memberTypes[i], out typeInformation);
                _binaryTypeEnumA[i] = binaryTypeEnum;
                _typeInformationA[i] = typeInformation;
            }
        }
Exemple #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++)
            {
                InternalPrimitiveTypeE primitiveTypeEnum;
                string typeString;
                Type   type;
                bool   isVariant;

                BinaryTypeConverter.TypeFromInfo(
                    binaryTypeEnumA[i], typeInformationA[i], objectReader, (BinaryAssemblyInfo)assemIdToAssemblyTable[memberAssemIds[i]],
                    out primitiveTypeEnum, out typeString, out type, out isVariant);
                _memberTypes[i] = type;
            }

            _objectInfo = objectReader.CreateReadObjectInfo(_objectType, memberNames, null);
            if (!_objectInfo._isSi)
            {
                _objectInfo.GetMemberTypes(memberNames, _objectInfo._objectType);  // Check version match
            }
        }
Exemple #4
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++)
            {
                InternalPrimitiveTypeE primitiveTypeEnum;
                string typeString;
                Type type;
                bool isVariant;

                BinaryTypeConverter.TypeFromInfo(
                    binaryTypeEnumA[i], typeInformationA[i], objectReader, (BinaryAssemblyInfo)assemIdToAssemblyTable[memberAssemIds[i]],
                    out primitiveTypeEnum, out typeString, out type, out isVariant);
                _memberTypes[i] = type;
            }

            _objectInfo = objectReader.CreateReadObjectInfo(_objectType, memberNames, null);
            if (!_objectInfo._isSi)
            {
                _objectInfo.GetMemberTypes(memberNames, _objectInfo._objectType);  // Check version match
            }
        }