public override void ReadFrom(System.IO.BinaryReader reader) { base.ReadFrom(reader); FormatChecker.CheckExpression(() => BlockSize == ExactBlockSize); Length = reader.ReadInt32(); FormatChecker.CheckExpression(() => Length >= MinimumLength); Item.Version = reader.ReadInt32(); Item.MachineID = reader.ReadASCIIZF(Encoding.Default, MachineIDLength); // 16 bytes, 0 fill Item.Droid = new[] { new Guid(reader.ReadBytes(16)), new Guid(reader.ReadBytes(16)) }; Item.DroidBirth = new[] { new Guid(reader.ReadBytes(16)), new Guid(reader.ReadBytes(16)) }; }
public override void ReadFrom(System.IO.BinaryReader reader) { base.ReadFrom(reader); FormatChecker.CheckExpression(() => BlockSize == ExactBlockSize); Item.FillAttributes = (FillAttributes)reader.ReadUInt16(); Item.PopupFillAttributes = (FillAttributes)reader.ReadUInt16(); Item.ScreenBufferSize = new Size(reader.ReadInt16(), reader.ReadInt16()); Item.WindowSize = new Size(reader.ReadInt16(), reader.ReadInt16()); Item.WindowOrigin = new Point(reader.ReadInt16(), reader.ReadInt16()); reader.ReadBytes(UnusedLength); //Item.FontSize = reader.ReadInt32(); reader.ReadInt16(); Item.FontSize = reader.ReadInt16(); Item.FontFamily = (ExtraData.FontFamily)reader.ReadUInt32(); Item.FontWeight = reader.ReadUInt32(); // Keep unknown data padding to preserve valid file roundtrip byte[] padding; Item.FaceName = reader.ReadASCIIZF(Encoding.Unicode, FaceNameLength, out padding); Item.FaceNamePadding = padding; Item.CursorSize = reader.ReadUInt32(); Item.FullScreen = reader.ReadUInt32() > 0; Item.FastEdit = reader.ReadUInt32() > 0; Item.InsertMode = reader.ReadUInt32() > 0; Item.AutoPosition = reader.ReadUInt32() > 0; Item.HistoryBufferSize = reader.ReadUInt32(); Item.NumberOfHistoryBuffers = reader.ReadUInt32(); Item.HistoryDuplicateAllowed = reader.ReadUInt32() > 0; Item.ColorTable = reader.ReadBytes(ColorTableLength); }