Пример #1
0
        public ShtProps(IStreamReader reader, RecordType id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            ushort flags = reader.ReadUInt16();

            this.fManSerAlloc        = Utils.BitmaskToBool(flags, 0x1);
            this.fPlotVisOnly        = Utils.BitmaskToBool(flags, 0x2);
            this.fNotSizeWith        = Utils.BitmaskToBool(flags, 0x4);
            this.fManPlotArea        = Utils.BitmaskToBool(flags, 0x8);
            this.fAlwaysAutoPlotArea = Utils.BitmaskToBool(flags, 0x10);

            this.mdBlank = (EmptyCellPlotMode)reader.ReadByte();
            if (length > 3)
            {
                // skip the last optional byte
                reader.ReadByte();
            }

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
Пример #2
0
        public ShtProps(IStreamReader reader, GraphRecordNumber id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            ushort flags = reader.ReadUInt16();

            this.fManSerAlloc = Utils.BitmaskToBool(flags, 0x1);
            // 0x2 and 0x4 are reserved
            this.fManPlotArea        = Utils.BitmaskToBool(flags, 0x8);
            this.fAlwaysAutoPlotArea = Utils.BitmaskToBool(flags, 0x10);
            this.mdBlank             = (EmptyCellPlotMode)reader.ReadByte();
            reader.ReadByte(); // skip the last byte

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }