GetMemberTypes() private method

private GetMemberTypes ( string inMemberNames, Type objectType ) : System.Type[]
inMemberNames string
objectType System.Type
return System.Type[]
Example #1
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
            }
        }
Example #2
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;
            }
        }
        [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;
            } 
        }