/// <summary> /// Deserialize the class data from a stream. /// </summary> /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param> /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream; /// the version of the <paramref name="reader"/> data.</param> public void Deserialize(IPrimitiveReader reader, int version) { using (reader.CreateRegion()) { //FullDataIdType FullDataIdType = (FullDataIdType)reader.ReadByte(); //TagName TagName = reader.ReadString(); if (version >= 2) { //Offset reader.ReadInt32(); //Count reader.ReadInt32(); //DataType DataType = (DataType)reader.ReadByte(); //FullDataIdFieldList if (reader.ReadBoolean()) { FullDataIdFieldList = new FullDataIdFieldList(); Serializer.Deserialize(reader.BaseStream, FullDataIdFieldList); } //FullDataIdPartFormat FullDataIdPartFormat = (FullDataIdPartFormat)reader.ReadByte(); } } }
/// <summary> /// Deserialize the class data from a stream. /// </summary> /// <param name="reader">The <see cref="T:MySpace.Common.IO.IPrimitiveReader"/> that extracts used to extra data from a stream.</param> /// <param name="version">The value of <see cref="P:MySpace.Common.IVersionSerializable.CurrentVersion"/> that was written to the stream when it was originally serialized to a stream; /// the version of the <paramref name="reader"/> data.</param> public void Deserialize(IPrimitiveReader reader, int version) { using (reader.CreateRegion()) { //FullDataIdType FullDataIdType = (FullDataIdType)reader.ReadByte(); //TagName TagName = reader.ReadString(); if (version >= 2) { //Offset reader.ReadInt32(); //Count reader.ReadInt32(); //DataType DataType = (DataType)reader.ReadByte(); //FullDataIdFieldList if (reader.ReadBoolean()) { FullDataIdFieldList = new FullDataIdFieldList(); Serializer.Deserialize(reader.BaseStream, FullDataIdFieldList); } //FullDataIdPartFormat FullDataIdPartFormat = (FullDataIdPartFormat)reader.ReadByte(); } } }