internal static void GetTypeAdditionalInfo(TypeHoldingThing typeHolder, BinarySerializationStreamAnalyzer analyzer) { switch (typeHolder.BinaryType) { case BinaryTypeEnumeration.Primitive: case BinaryTypeEnumeration.PrimitiveArray: typeHolder.PrimitiveType = (PrimitiveTypeEnumeration)analyzer.reader.ReadByte(); break; case BinaryTypeEnumeration.String: break; case BinaryTypeEnumeration.Object: break; case BinaryTypeEnumeration.SystemClass: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.reader.ReadString(); break; case BinaryTypeEnumeration.Class: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.reader.ReadString(); typeHolder.TypeInfo.LibraryID = analyzer.ReadID(); break; case BinaryTypeEnumeration.ObjectArray: break; case BinaryTypeEnumeration.StringArray: break; } }
internal static void GetTypeAdditionalInfo(TypeHoldingThing typeHolder, BinarySerializationStreamAnalyzer analyzer) { MemberInfo info = typeHolder as MemberInfo; string varName = (info == null) ? "???" : info.Name; switch (typeHolder.BinaryType) { case BinaryTypeEnumeration.Primitive: typeHolder.PrimitiveType = (PrimitiveTypeEnumeration)analyzer.reader.ReadByte(); LogInternal(varName + ": PrimitiveType=" + Enum.GetName(typeof(PrimitiveTypeEnumeration), typeHolder.PrimitiveType)); break; case BinaryTypeEnumeration.String: break; case BinaryTypeEnumeration.Object: break; case BinaryTypeEnumeration.SystemClass: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.reader.ReadString(); LogInternal(varName + ": SystemClass=" + typeHolder.TypeInfo.TypeName); break; case BinaryTypeEnumeration.Class: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.reader.ReadString(); typeHolder.TypeInfo.LibraryID = analyzer.reader.ReadInt32(); LogInternal(varName + ": Class=" + typeHolder.TypeInfo.TypeName + "@" + typeHolder.TypeInfo.LibraryID); break; case BinaryTypeEnumeration.ObjectArray: break; case BinaryTypeEnumeration.StringArray: break; case BinaryTypeEnumeration.PrimitiveArray: typeHolder.PrimitiveType = (PrimitiveTypeEnumeration)analyzer.reader.ReadByte(); LogInternal(varName + ": PrimitiveArray=" + Enum.GetName(typeof(PrimitiveTypeEnumeration), typeHolder.PrimitiveType)); break; } }
internal static void GetTypeAdditionalInfo(TypeHoldingThing typeHolder, SerReader analyzer) { switch (typeHolder.BinaryType) { case BinaryTypeEnumeration.Primitive: typeHolder.PrimitiveType = (PrimitiveTypeEnumeration)analyzer.reader.ReadByte(); break; case BinaryTypeEnumeration.String: break; case BinaryTypeEnumeration.Object: break; case BinaryTypeEnumeration.SystemClass: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.ReadMarkString(); break; case BinaryTypeEnumeration.Class: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.ReadMarkString(); int libraryId = analyzer.reader.ReadInt32(); analyzer.FixTypeName(analyzer.LibrariesFound[libraryId].Name, typeHolder.TypeInfo.TypeName); break; case BinaryTypeEnumeration.ObjectArray: break; case BinaryTypeEnumeration.StringArray: break; case BinaryTypeEnumeration.PrimitiveArray: typeHolder.PrimitiveType = (PrimitiveTypeEnumeration)analyzer.reader.ReadByte(); break; } }
internal static void GetTypeValue(TypeHoldingThing typeHolder, ValueHoldingThing valueHolder, SerReader analyzer) { switch (typeHolder.BinaryType) { case BinaryTypeEnumeration.Primitive: switch (typeHolder.PrimitiveType) { case PrimitiveTypeEnumeration.Boolean: valueHolder.Value = analyzer.reader.ReadBoolean(); break; case PrimitiveTypeEnumeration.Byte: valueHolder.Value = analyzer.reader.ReadByte(); break; case PrimitiveTypeEnumeration.Char: valueHolder.Value = analyzer.reader.ReadChar(); break; case PrimitiveTypeEnumeration.DateTime: valueHolder.Value = DateTime.FromBinary(analyzer.reader.ReadInt64()); break; case PrimitiveTypeEnumeration.Decimal: string decimalValue = analyzer.reader.ReadString(); valueHolder.Value = decimal.Parse(decimalValue); break; case PrimitiveTypeEnumeration.Double: valueHolder.Value = analyzer.reader.ReadDouble(); break; case PrimitiveTypeEnumeration.Int16: valueHolder.Value = analyzer.reader.ReadInt16(); break; case PrimitiveTypeEnumeration.Int32: valueHolder.Value = analyzer.reader.ReadInt32(); break; case PrimitiveTypeEnumeration.Int64: valueHolder.Value = analyzer.reader.ReadInt64(); break; case PrimitiveTypeEnumeration.Null: valueHolder.Value = null; break; case PrimitiveTypeEnumeration.SByte: valueHolder.Value = analyzer.reader.ReadSByte(); break; case PrimitiveTypeEnumeration.Single: valueHolder.Value = analyzer.reader.ReadSingle(); break; case PrimitiveTypeEnumeration.String: valueHolder.Value = analyzer.ReadAndFixString(); break; case PrimitiveTypeEnumeration.TimeSpan: valueHolder.Value = TimeSpan.FromTicks(analyzer.reader.ReadInt64()); break; case PrimitiveTypeEnumeration.UInt16: valueHolder.Value = analyzer.reader.ReadUInt16(); break; case PrimitiveTypeEnumeration.UInt32: valueHolder.Value = analyzer.reader.ReadUInt32(); break; case PrimitiveTypeEnumeration.UInt64: valueHolder.Value = analyzer.reader.ReadUInt64(); break; } break; case BinaryTypeEnumeration.String: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.Object: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.SystemClass: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.Class: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.ObjectArray: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.StringArray: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.PrimitiveArray: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; } }
internal static void GetTypeAdditionalInfo(TypeHoldingThing typeHolder, BinarySerializationStreamAnalyzer analyzer) { switch(typeHolder.BinaryType) { case BinaryTypeEnumeration.Primitive: case BinaryTypeEnumeration.PrimitiveArray: typeHolder.PrimitiveType = (PrimitiveTypeEnumeration)analyzer.reader.ReadByte(); break; case BinaryTypeEnumeration.String: break; case BinaryTypeEnumeration.Object: break; case BinaryTypeEnumeration.SystemClass: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.reader.ReadString(); break; case BinaryTypeEnumeration.Class: typeHolder.TypeInfo = new ClassTypeInfo(); typeHolder.TypeInfo.TypeName = analyzer.reader.ReadString(); typeHolder.TypeInfo.LibraryID = analyzer.ReadID(); break; case BinaryTypeEnumeration.ObjectArray: break; case BinaryTypeEnumeration.StringArray: break; } }
internal static void GetTypeValue(TypeHoldingThing typeHolder, ValueHoldingThing valueHolder, BinarySerializationStreamAnalyzer analyzer) { MemberInfo member = typeHolder as MemberInfo; string varName = (member == null) ? "???" : member.Name; switch (typeHolder.BinaryType) { case BinaryTypeEnumeration.Primitive: switch (typeHolder.PrimitiveType) { case PrimitiveTypeEnumeration.Boolean: valueHolder.Value = analyzer.reader.ReadBoolean(); break; case PrimitiveTypeEnumeration.Byte: valueHolder.Value = analyzer.reader.ReadByte(); break; case PrimitiveTypeEnumeration.Char: valueHolder.Value = analyzer.reader.ReadChar(); break; case PrimitiveTypeEnumeration.DateTime: valueHolder.Value = DateTime.FromBinary(analyzer.reader.ReadInt64()); break; case PrimitiveTypeEnumeration.Decimal: string decimalValue = analyzer.reader.ReadString(); valueHolder.Value = decimal.Parse(decimalValue); valueHolder.Value = analyzer.reader.ReadDecimal(); break; case PrimitiveTypeEnumeration.Double: valueHolder.Value = analyzer.reader.ReadDouble(); break; case PrimitiveTypeEnumeration.Int16: valueHolder.Value = analyzer.reader.ReadInt16(); break; case PrimitiveTypeEnumeration.Int32: valueHolder.Value = analyzer.reader.ReadInt32(); break; case PrimitiveTypeEnumeration.Int64: valueHolder.Value = analyzer.reader.ReadInt64(); break; case PrimitiveTypeEnumeration.Null: valueHolder.Value = null; break; case PrimitiveTypeEnumeration.SByte: valueHolder.Value = analyzer.reader.ReadSByte(); break; case PrimitiveTypeEnumeration.Single: valueHolder.Value = analyzer.reader.ReadSingle(); break; case PrimitiveTypeEnumeration.String: valueHolder.Value = analyzer.reader.ReadString(); break; case PrimitiveTypeEnumeration.TimeSpan: valueHolder.Value = TimeSpan.FromTicks(analyzer.reader.ReadInt64()); break; case PrimitiveTypeEnumeration.UInt16: valueHolder.Value = analyzer.reader.ReadUInt16(); break; case PrimitiveTypeEnumeration.UInt32: valueHolder.Value = analyzer.reader.ReadUInt32(); break; case PrimitiveTypeEnumeration.UInt64: valueHolder.Value = analyzer.reader.ReadUInt64(); break; } LogInternal(Enum.GetName(typeof(PrimitiveTypeEnumeration), typeHolder.PrimitiveType) + " " + varName + " value=" + valueHolder.Value); break; case BinaryTypeEnumeration.String: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.Object: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.SystemClass: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.Class: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.ObjectArray: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.StringArray: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; case BinaryTypeEnumeration.PrimitiveArray: valueHolder.ValueRefID = analyzer.ParseRecord(typeHolder.RelevantObject); break; } }