public CharacterRun(BinaryReader reader)
        {
            try
            {
                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.ColorPresent)
                {
                    this.Color = new GrColorAtom(reader);
                }

                if (this.PositionPresent)
                {
                    this.Position = reader.ReadUInt16();
                }
            }
            catch (EndOfStreamException e)
            {
                string s = e.ToString();
                //ignore
            }
        }
Exemple #2
0
        public ParagraphRun(BinaryReader reader, bool noIndentField)
        {
            try
            {
                this.IndentLevel = noIndentField ? (ushort)0 : 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.BulletFontPresent)
                {
                    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();
                    this.TabStops = new TabStop[tabStopsCount];

                    for (int i = 0; i < tabStopsCount; i++)
                    {
                        this.TabStops[i] = new TabStop(reader);
                    }
                }

                if (this.FontAlignPresent)
                {
                    this.FontAlign = reader.ReadUInt16();
                }

                if (this.LineBreakFlagsFieldPresent)
                {
                    this.LineBreakFlags = reader.ReadUInt16();
                }

                if (this.TextDirectionPresent)
                {
                    this.TextDirection = reader.ReadUInt16();
                }
            }
            catch (Exception e)
            {
                string s = e.ToString();
            }
            //if (this.TabStopsPresent)
            //{
            //    UInt16 tabStopsCount = reader.ReadUInt16();
            //    this.TabStops = new TabStop[tabStopsCount];

            //    for (int i = 0; i < tabStopsCount; i++)
            //    {
            //        this.TabStops[i] = new TabStop(reader);
            //    }
            //}
        }