static private Create ( String name, String memberNames, BinaryTypeEnum binaryTypeEnumA, Object typeInformationA, int memberAssemIds, |
||
name | String | |
memberNames | String | |
binaryTypeEnumA | BinaryTypeEnum | |
typeInformationA | Object | |
memberAssemIds | int | |
objectReader | ||
objectId | ||
assemblyInfo | ||
assemIdToAssemblyTable | ||
Результат |
private void ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) { BinaryAssemblyInfo assemblyInfo = null; ObjectProgress op = GetOp(); ParseRecord pr = op._pr; _stack.Push(op); if (record._binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId) { if (record._assemId < 1) { throw new SerializationException(SR.Format(SR.Serialization_AssemblyId, record._name)); } assemblyInfo = (BinaryAssemblyInfo)AssemIdToAssemblyTable[record._assemId]; if (assemblyInfo == null) { throw new SerializationException(SR.Format(SR.Serialization_AssemblyId, record._assemId + " " + record._name)); } } else if (record._binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTyped) { assemblyInfo = SystemAssemblyInfo; // Urt assembly } ObjectMap objectMap = ObjectMap.Create(record._name, record._memberNames, record._binaryTypeEnumA, record._typeInformationA, record._memberAssemIds, _objectReader, record._objectId, assemblyInfo, AssemIdToAssemblyTable); ObjectMapIdTable[record._objectId] = objectMap; op._objectTypeEnum = InternalObjectTypeE.Object; op._binaryTypeEnumA = objectMap._binaryTypeEnumA; op._typeInformationA = objectMap._typeInformationA; op._memberLength = op._binaryTypeEnumA.Length; op._memberNames = objectMap._memberNames; op._memberTypes = objectMap._memberTypes; ObjectProgress objectOp = (ObjectProgress)_stack.PeekPeek(); if ((objectOp == null) || (objectOp._isInitial)) { // Non-Nested Object op._name = record._name; pr._parseTypeEnum = InternalParseTypeE.Object; op._memberValueEnum = InternalMemberValueE.Empty; } else { // Nested Object pr._parseTypeEnum = InternalParseTypeE.Member; pr._memberValueEnum = InternalMemberValueE.Nested; op._memberValueEnum = InternalMemberValueE.Nested; switch (objectOp._objectTypeEnum) { case InternalObjectTypeE.Object: pr._name = objectOp._name; pr._memberTypeEnum = InternalMemberTypeE.Field; op._memberTypeEnum = InternalMemberTypeE.Field; break; case InternalObjectTypeE.Array: pr._memberTypeEnum = InternalMemberTypeE.Item; op._memberTypeEnum = InternalMemberTypeE.Item; break; default: throw new SerializationException(SR.Format(SR.Serialization_ObjectTypeEnum, objectOp._objectTypeEnum.ToString())); } } pr._objectTypeEnum = InternalObjectTypeE.Object; pr._objectInfo = objectMap.CreateObjectInfo(ref pr._si, ref pr._memberData); pr._objectId = _objectReader.GetId(record._objectId); if (pr._objectId == _topId) { pr._objectPositionEnum = InternalObjectPositionE.Top; } pr._keyDt = record._name; pr._dtType = objectMap._objectType; pr._dtTypeCode = InternalPrimitiveTypeE.Invalid; _objectReader.Parse(pr); }
private void ReadObjectWithMap(BinaryObjectWithMap record) { BinaryAssemblyInfo assemblyInfo = null; ObjectProgress op = this.GetOp(); ParseRecord pr = op.pr; this.stack.Push(op); if (record.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapAssemId) { if (record.assemId < 1) { throw new SerializationException(Environment.GetResourceString("Serialization_Assembly", new object[] { record.name })); } assemblyInfo = (BinaryAssemblyInfo)this.AssemIdToAssemblyTable[record.assemId]; if (assemblyInfo == null) { throw new SerializationException(Environment.GetResourceString("Serialization_Assembly", new object[] { record.assemId + " " + record.name })); } } else if (record.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMap) { assemblyInfo = this.SystemAssemblyInfo; } Type objectType = this.objectReader.GetType(assemblyInfo, record.name); ObjectMap map = ObjectMap.Create(record.name, objectType, record.memberNames, this.objectReader, record.objectId, assemblyInfo); this.ObjectMapIdTable[record.objectId] = map; op.objectTypeEnum = InternalObjectTypeE.Object; op.binaryTypeEnumA = map.binaryTypeEnumA; op.typeInformationA = map.typeInformationA; op.memberLength = op.binaryTypeEnumA.Length; op.memberNames = map.memberNames; op.memberTypes = map.memberTypes; ObjectProgress progress2 = (ObjectProgress)this.stack.PeekPeek(); if ((progress2 == null) || progress2.isInitial) { op.name = record.name; pr.PRparseTypeEnum = InternalParseTypeE.Object; op.memberValueEnum = InternalMemberValueE.Empty; } else { pr.PRparseTypeEnum = InternalParseTypeE.Member; pr.PRmemberValueEnum = InternalMemberValueE.Nested; op.memberValueEnum = InternalMemberValueE.Nested; switch (progress2.objectTypeEnum) { case InternalObjectTypeE.Object: pr.PRname = progress2.name; pr.PRmemberTypeEnum = InternalMemberTypeE.Field; op.memberTypeEnum = InternalMemberTypeE.Field; goto Label_0213; case InternalObjectTypeE.Array: pr.PRmemberTypeEnum = InternalMemberTypeE.Item; op.memberTypeEnum = InternalMemberTypeE.Field; goto Label_0213; } throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", new object[] { progress2.objectTypeEnum.ToString() })); } Label_0213: pr.PRobjectTypeEnum = InternalObjectTypeE.Object; pr.PRobjectId = this.objectReader.GetId((long)record.objectId); pr.PRobjectInfo = map.CreateObjectInfo(ref pr.PRsi, ref pr.PRmemberData); if (pr.PRobjectId == this.topId) { pr.PRobjectPositionEnum = InternalObjectPositionE.Top; } pr.PRkeyDt = record.name; pr.PRdtType = map.objectType; pr.PRdtTypeCode = InternalPrimitiveTypeE.Invalid; this.objectReader.Parse(pr); }
private void ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) { BinaryAssemblyInfo assemblyInfo = (BinaryAssemblyInfo)null; ObjectProgress op = this.GetOp(); ParseRecord pr = op.pr; this.stack.Push((object)op); if (record.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId) { if (record.assemId < 1) { throw new SerializationException(Environment.GetResourceString("Serialization_AssemblyId", (object)record.name)); } assemblyInfo = (BinaryAssemblyInfo)this.AssemIdToAssemblyTable[record.assemId]; if (assemblyInfo == null) { throw new SerializationException(Environment.GetResourceString("Serialization_AssemblyId", (object)(record.assemId.ToString() + " " + record.name))); } } else if (record.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTyped) { assemblyInfo = this.SystemAssemblyInfo; } ObjectMap objectMap = ObjectMap.Create(record.name, record.memberNames, record.binaryTypeEnumA, record.typeInformationA, record.memberAssemIds, this.objectReader, record.objectId, assemblyInfo, this.AssemIdToAssemblyTable); this.ObjectMapIdTable[record.objectId] = (object)objectMap; op.objectTypeEnum = InternalObjectTypeE.Object; op.binaryTypeEnumA = objectMap.binaryTypeEnumA; op.typeInformationA = objectMap.typeInformationA; ObjectProgress objectProgress1 = op; int length = objectProgress1.binaryTypeEnumA.Length; objectProgress1.memberLength = length; op.memberNames = objectMap.memberNames; op.memberTypes = objectMap.memberTypes; ObjectProgress objectProgress2 = (ObjectProgress)this.stack.PeekPeek(); if (objectProgress2 == null || objectProgress2.isInitial) { op.name = record.name; pr.PRparseTypeEnum = InternalParseTypeE.Object; op.memberValueEnum = InternalMemberValueE.Empty; } else { pr.PRparseTypeEnum = InternalParseTypeE.Member; pr.PRmemberValueEnum = InternalMemberValueE.Nested; op.memberValueEnum = InternalMemberValueE.Nested; switch (objectProgress2.objectTypeEnum) { case InternalObjectTypeE.Object: pr.PRname = objectProgress2.name; pr.PRmemberTypeEnum = InternalMemberTypeE.Field; op.memberTypeEnum = InternalMemberTypeE.Field; break; case InternalObjectTypeE.Array: pr.PRmemberTypeEnum = InternalMemberTypeE.Item; op.memberTypeEnum = InternalMemberTypeE.Item; break; default: throw new SerializationException(Environment.GetResourceString("Serialization_ObjectTypeEnum", (object)objectProgress2.objectTypeEnum.ToString())); } } pr.PRobjectTypeEnum = InternalObjectTypeE.Object; pr.PRobjectInfo = objectMap.CreateObjectInfo(ref pr.PRsi, ref pr.PRmemberData); pr.PRobjectId = this.objectReader.GetId((long)record.objectId); if (pr.PRobjectId == this.topId) { pr.PRobjectPositionEnum = InternalObjectPositionE.Top; } pr.PRkeyDt = record.name; pr.PRdtType = objectMap.objectType; pr.PRdtTypeCode = InternalPrimitiveTypeE.Invalid; this.objectReader.Parse(pr); }
private void ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) { BinaryAssemblyInfo assemblyInfo = null; ObjectProgress op = GetOp(); ParseRecord pr = op.pr; stack.Push(op); if (record.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId) { if (record.assemId < 1) { throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_AssemblyId"), record.name)); } assemblyInfo = (BinaryAssemblyInfo)AssemIdToAssemblyTable[record.assemId]; if (assemblyInfo == null) { throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_AssemblyId"), record.assemId + " " + record.name)); } SerTrace.Log(this, "ReadObjectWithMapTyped lookup assemIdToAssembly assemId ", record.assemId, " assembly ", assemblyInfo.assemblyString); } else if (record.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTyped) { assemblyInfo = SystemAssemblyInfo; // Urt assembly } ObjectMap objectMap = ObjectMap.Create(record.name, record.memberNames, record.binaryTypeEnumA, record.typeInformationA, record.memberAssemIds, objectReader, record.objectId, assemblyInfo, AssemIdToAssemblyTable); ObjectMapIdTable[record.objectId] = objectMap; op.objectTypeEnum = InternalObjectTypeE.Object; op.binaryTypeEnumA = objectMap.binaryTypeEnumA; op.typeInformationA = objectMap.typeInformationA; op.memberLength = op.binaryTypeEnumA.Length; op.memberNames = objectMap.memberNames; op.memberTypes = objectMap.memberTypes; ObjectProgress objectOp = (ObjectProgress)stack.PeekPeek(); if ((objectOp == null) || (objectOp.isInitial)) { // Non-Nested Object op.name = record.name; pr.PRparseTypeEnum = InternalParseTypeE.Object; op.memberValueEnum = InternalMemberValueE.Empty; } else { // Nested Object pr.PRparseTypeEnum = InternalParseTypeE.Member; pr.PRmemberValueEnum = InternalMemberValueE.Nested; op.memberValueEnum = InternalMemberValueE.Nested; switch (objectOp.objectTypeEnum) { case InternalObjectTypeE.Object: pr.PRname = objectOp.name; pr.PRmemberTypeEnum = InternalMemberTypeE.Field; op.memberTypeEnum = InternalMemberTypeE.Field; break; case InternalObjectTypeE.Array: pr.PRmemberTypeEnum = InternalMemberTypeE.Item; op.memberTypeEnum = InternalMemberTypeE.Item; break; default: throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_ObjectTypeEnum"), ((Enum)objectOp.objectTypeEnum).ToString())); } } pr.PRobjectTypeEnum = InternalObjectTypeE.Object; pr.PRobjectInfo = objectMap.CreateObjectInfo(ref pr.PRsi, ref pr.PRmemberData); pr.PRobjectId = objectReader.GetId((long)record.objectId); if (pr.PRobjectId == topId) { pr.PRobjectPositionEnum = InternalObjectPositionE.Top; } pr.PRkeyDt = record.name; pr.PRdtType = objectMap.objectType; pr.PRdtTypeCode = InternalPrimitiveTypeE.Invalid; objectReader.Parse(pr); }