public CharacterRun(BinaryReader reader) { this.Length = reader.ReadUInt32(); this.Mask = (CharacterMask)reader.ReadUInt32(); if (this.StyleFlagsFieldPresent) { this.Style = (StyleMask)reader.ReadUInt16(); } if (this.TypefacePresent) { this.TypefaceIdx = reader.ReadUInt16(); } if (this.FEOldTypefacePresent) { this.FEOldTypefaceIdx = reader.ReadUInt16(); } if (this.ANSITypefacePresent) { this.ANSITypefaceIdx = reader.ReadUInt16(); } if (this.SymbolTypefacePresent) { this.SymbolTypefaceIdx = reader.ReadUInt16(); } if (this.SizePresent) { this.Size = reader.ReadUInt16(); } if (this.PositionPresent) { this.Position = reader.ReadUInt16(); } if (this.ColorPresent) { this.Color = new GrColorAtom(reader); } }
public ParagraphRun(BinaryReader reader) { this.Length = reader.ReadUInt32(); this.IndentLevel = reader.ReadUInt16(); this.Mask = (ParagraphMask)reader.ReadUInt32(); // Note: These appear in Mask as well -- there they are true // when the flag differs from the Master style. // The actual value for the differing flags is stored here. // (TODO: This is still a guess. Verify.) if (this.BulletFlagsFieldPresent) { this.BulletFlags = reader.ReadUInt16(); } if (this.BulletCharPresent) { this.BulletChar = (char)reader.ReadUInt16(); } if (this.BulletTypefacePresent) { this.BulletTypefaceIdx = reader.ReadUInt16(); } if (this.BulletSizePresent) { this.BulletSize = reader.ReadInt16(); } if (this.BulletColorPresent) { this.BulletColor = new GrColorAtom(reader); } if (this.AlignmentPresent) { this.Alignment = reader.ReadInt16(); } if (this.LineSpacingPresent) { this.LineSpacing = reader.ReadInt16(); } if (this.SpaceBeforePresent) { this.SpaceBefore = reader.ReadInt16(); } if (this.SpaceAfterPresent) { this.SpaceAfter = reader.ReadInt16(); } if (this.LeftMarginPresent) { this.LeftMargin = reader.ReadInt16(); } if (this.IndentPresent) { this.Indent = reader.ReadInt16(); } if (this.DefaultTabSizePresent) { this.DefaultTabSize = reader.ReadInt16(); } if (this.TabStopsPresent) { UInt16 tabStopsCount = reader.ReadUInt16(); if (tabStopsCount != 0) { throw new NotImplementedException("Tab stop reading not yet implemented"); // TODO } } if (this.BaseLinePresent) { this.BaseLine = reader.ReadUInt16(); } if (this.LineBreakFlagsFieldPresent) { this.LineBreakFlags = reader.ReadUInt16(); } if (this.TextDirectionPresent) { this.TextDirection = reader.ReadUInt16(); } }