public RTFFormatWrap(RTFBuilder builder)
            {
                this._builder = builder;
                if (this._builder._unwrapped)
                {
                    return;
                }

                StringBuilder sb = this._builder._sb;

                int len = this._builder._sb.Length;

                if (this._builder._sf.Alignment == StringAlignment.Center)
                {
                    sb.Append("\\qc");
                }
                else if (this._builder._sf.Alignment == StringAlignment.Far)
                {
                    sb.Append("\\qr");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Bold) == System.Drawing.FontStyle.Bold)
                {
                    sb.Append("\\b");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Italic) == System.Drawing.FontStyle.Italic)
                {
                    sb.Append("\\i");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Underline) == System.Drawing.FontStyle.Underline)
                {
                    sb.Append("\\ul");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Strikeout) == System.Drawing.FontStyle.Strikeout)
                {
                    sb.Append("\\strike");
                }

                if (this._builder._fontSize != this._builder.DefaultFontSize)
                {
                    sb.AppendFormat("\\fs{0}", this._builder._fontSize);
                }
                if (this._builder._font != 0)
                {
                    sb.AppendFormat("\\f{0}", this._builder._font);
                }
                if (this._builder._forecolor != this._builder.Defaultforecolor)
                {
                    sb.AppendFormat("\\cf{0}", this._builder.IndexOf(this._builder._forecolor));
                }
                if (this._builder._backcolor != this._builder.DefaultBackColor)
                {
                    sb.AppendFormat("\\highlight{0}", this._builder.IndexOf(this._builder._backcolor));
                }


                if (sb.Length > len)
                {
                    sb.Append(" ");
                }
            }
            public RTFParaWrap(RTFBuilder builder)
            {
                this._builder = builder;
                int len = this._builder._sb.Length;
                if (this._builder._sf.Alignment == StringAlignment.Center)
                {
                    this._builder._sb.Append("\\qc");
                }
                else if (this._builder._sf.Alignment == StringAlignment.Far)
                {
                    this._builder._sb.Append("\\qr");
                }
                if (this._builder._firstLineIndent > 0)
                {
                    this._builder._sb.Append("\\fi" + this._builder._firstLineIndent);
                }
                if (this._builder._lineIndent > 0)
                {
                    this._builder._sb.Append("\\li" + this._builder._lineIndent);
                }


                if (this._builder._sb.Length > len)
                {
                    this._builder._sb.Append(" ");
                }
            }
            public RTFFormatWrap(RTFBuilder builder)
            {
                this._builder = builder;
                if (this._builder._unwrapped)
                {
                    return;
                }

                StringBuilder sb = this._builder._sb;

                int len = this._builder._sb.Length;

                if (this._builder._sf.Alignment == StringAlignment.Center)
                {
                    sb.Append("\\qc");
                }
                else if (this._builder._sf.Alignment == StringAlignment.Far)
                {
                    sb.Append("\\qr");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Bold) == System.Drawing.FontStyle.Bold)
                {
                    sb.Append("\\b");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Italic) == System.Drawing.FontStyle.Italic)
                {
                    sb.Append("\\i");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Underline) == System.Drawing.FontStyle.Underline)
                {
                    sb.Append("\\ul");
                }
                if ((this._builder._fontStyle & System.Drawing.FontStyle.Strikeout) == System.Drawing.FontStyle.Strikeout)
                {
                    sb.Append("\\strike");
                }

                if (this._builder._fontSize != this._builder.DefaultFontSize)
                {
                    sb.AppendFormat("\\fs{0}", this._builder._fontSize);
                }
                if (this._builder._font != 0)
                {
                    sb.AppendFormat("\\f{0}", this._builder._font);
                }
                if (this._builder._forecolor != this._builder.Defaultforecolor)
                {
                    sb.AppendFormat("\\cf{0}", this._builder.IndexOf(this._builder._forecolor));
                }
                if (this._builder._backcolor != this._builder.DefaultBackColor)
                {
                    sb.AppendFormat("\\highlight{0}", this._builder.IndexOf(this._builder._backcolor));
                }


                if (sb.Length > len)
                {
                    sb.Append(" ");
                }
            }
Esempio n. 4
0
            public RTFParaWrap(RTFBuilder builder)
            {
                this._builder = builder;
                int len = this._builder._sb.Length;

                if (this._builder._sf.Alignment == StringAlignment.Center)
                {
                    this._builder._sb.Append("\\qc");
                }
                else if (this._builder._sf.Alignment == StringAlignment.Far)
                {
                    this._builder._sb.Append("\\qr");
                }
                if (this._builder._firstLineIndent > 0)
                {
                    this._builder._sb.Append("\\fi" + this._builder._firstLineIndent);
                }
                if (this._builder._lineIndent > 0)
                {
                    this._builder._sb.Append("\\li" + this._builder._lineIndent);
                }


                if (this._builder._sb.Length > len)
                {
                    this._builder._sb.Append(" ");
                }
            }
            internal RTFCellDefinitionBuilder(RTFBuilder builder, StringBuilder definitionBuilder, RTFCellDefinition cellDefinition)
            {
                this._builder = builder;

                this._definitionBuilder = definitionBuilder;
                this._cellDefinition = cellDefinition;


                this.AppendDefinition();
            }
            internal RTFCellDefinitionBuilder(RTFBuilder builder, StringBuilder definitionBuilder, RTFCellDefinition cellDefinition)
            {
                this._builder = builder;

                this._definitionBuilder = definitionBuilder;
                this._cellDefinition    = cellDefinition;


                this.AppendDefinition();
            }
Esempio n. 7
0
 protected void Dispose(bool disposing)
 {
     if (disposing && this._builder != null)
     {
         this._builder._sb.AppendLine("\\cell ");
     }
     this._builder = null;
     if (disposing)
     {
         GC.SuppressFinalize(this);
     }
 }
Esempio n. 8
0
 protected void Dispose(bool disposing)
 {
     if (disposing && this._builder != null)
     {
         this._builder._sb.AppendLine("\\cell ");
     }
     this._builder = null;
     if (disposing)
     {
         GC.SuppressFinalize(this);
     }
 }
Esempio n. 9
0
            protected void Dispose(bool disposing)
            {
                if (this._builder != null)
                {
                    this._builder._sb.AppendLine("\\row");
                    //_builder._sb.AppendLine();
                    this._builder._sb.AppendLine("{");
                    this._builder._sb.Append(this._definitionBuilder.ToString());

                    this._builder._sb.AppendLine("}");
                }
                this._builder = null;
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
            }
 public RTFBuilderUnWrapped(RTFBuilder builder)
 {
     this.wrapped = new RTFFormatWrap(builder);
     this._builder = builder;
     this._builder._unwrapped = true;
 }
Esempio n. 11
0
            internal RTFRow(RTFBuilder builder, RTFRowDefinition rowDefinition, RTFCellDefinition[] cellDefinitions)
            {
                if (builder == null)
                {
                    throw new ArgumentNullException("builder");
                }
                if (cellDefinitions == null)
                {
                    throw new ArgumentNullException("cellDefinitions");
                }
                if (rowDefinition.RowWidth == 0)
                {
                    throw new ArgumentNullException("rowDefinition.RowWidth");
                }
                if (cellDefinitions.Length == 0)
                {
                    throw new ArgumentNullException("cellDefinitions.Length");
                }
                this._definitionBuilder = new StringBuilder();


                this._rowDefinition = rowDefinition;
                this._cellDefinitions = cellDefinitions;
                this._builder = builder;

                StringBuilder sb = this._definitionBuilder;

                sb.Append("\\trowd\\trgaph115\\trleft-115");
                sb.AppendLine("\\trautofit1"); //AutoFit: ON
                this.TableCellBorderSide();
                this.BorderDef();
                //Pad();


                // \trhdr	Table row header. This row should appear at the top of every page on which the current table appears.
                // \trkeep	Keep table row together. This row cannot be split by a page break. This property is assumed to be off unless the control word is present.
                //\trleftN	Position in twips of the leftmost edge of the table with respect to the left edge of its column.
                //\trqc	Centers a table row with respect to its containing column.
                //\trql	Left-justifies a table row with respect to its containing column.
                //\trqr	Right-justifies a table row with respect to its containing column.
                //\trrhN	Height of a table row in twips. When 0, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line.
                //\trpaddbN	Default bottom cell margin or padding for the row.
                //\trpaddlN	Default left cell margin or padding for the row.
                //\trpaddrN	Default right cell margin or padding for the row.
                //\trpaddtN	Default top cell margin or padding for the row.
                //\trpaddfbN	Units for \trpaddbN:
                //0	Null. Ignore \trpaddbN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.
                //\trpaddflN	Units for \trpaddlN:
                //0	Null. Ignore \trpaddlN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.
                //\trpaddfrN	Units for \trpaddrN:
                //0	Null. Ignore \trpaddrN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.
                //\trpaddftN	Units for \trpaddtN:
                //0	Null. Ignore \trpaddtN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.


                this._cells = new List <RTFCellDefinitionBuilder>();
                int x = 0;
                foreach (RTFCellDefinition item in this._cellDefinitions)
                {
                    item.SetX(x);
                    x += (int) (item.CellWidthRaw * TWIPSA4);
                    this._cells.Add(new RTFCellDefinitionBuilder(this._builder, this._definitionBuilder, item));
                }
                this._builder._sb.Append(this._definitionBuilder.ToString());
            }
Esempio n. 12
0
            protected void Dispose(bool disposing)
            {
                if (this._builder != null)
                {
                    this._builder._sb.AppendLine("\\row");
                    //_builder._sb.AppendLine();
                    this._builder._sb.AppendLine("{");
                    this._builder._sb.Append(this._definitionBuilder.ToString());

                    this._builder._sb.AppendLine("}");
                }
                this._builder = null;
                if (disposing)
                {
                    GC.SuppressFinalize(this);
                }
            }
 public RTFBuilderUnWrapped(RTFBuilder builder)
 {
     this.wrapped             = new RTFFormatWrap(builder);
     this._builder            = builder;
     this._builder._unwrapped = true;
 }
Esempio n. 14
0
 public RTFImage(RTFBuilder builder)
 {
     this._builder = builder;
     this.sb = new StringBuilder();
 }
Esempio n. 15
0
            internal RTFRow(RTFBuilder builder, RTFRowDefinition rowDefinition, RTFCellDefinition[] cellDefinitions)
            {
                if (builder == null)
                {
                    throw new ArgumentNullException("builder");
                }
                if (cellDefinitions == null)
                {
                    throw new ArgumentNullException("cellDefinitions");
                }
                if (rowDefinition.RowWidth == 0)
                {
                    throw new ArgumentNullException("rowDefinition.RowWidth");
                }
                if (cellDefinitions.Length == 0)
                {
                    throw new ArgumentNullException("cellDefinitions.Length");
                }
                this._definitionBuilder = new StringBuilder();


                this._rowDefinition   = rowDefinition;
                this._cellDefinitions = cellDefinitions;
                this._builder         = builder;

                StringBuilder sb = this._definitionBuilder;

                sb.Append("\\trowd\\trgaph115\\trleft-115");
                sb.AppendLine("\\trautofit1"); //AutoFit: ON
                this.TableCellBorderSide();
                this.BorderDef();
                //Pad();


                // \trhdr	Table row header. This row should appear at the top of every page on which the current table appears.
                // \trkeep	Keep table row together. This row cannot be split by a page break. This property is assumed to be off unless the control word is present.
                //\trleftN	Position in twips of the leftmost edge of the table with respect to the left edge of its column.
                //\trqc	Centers a table row with respect to its containing column.
                //\trql	Left-justifies a table row with respect to its containing column.
                //\trqr	Right-justifies a table row with respect to its containing column.
                //\trrhN	Height of a table row in twips. When 0, the height is sufficient for all the text in the line; when positive, the height is guaranteed to be at least the specified height; when negative, the absolute value of the height is used, regardless of the height of the text in the line.
                //\trpaddbN	Default bottom cell margin or padding for the row.
                //\trpaddlN	Default left cell margin or padding for the row.
                //\trpaddrN	Default right cell margin or padding for the row.
                //\trpaddtN	Default top cell margin or padding for the row.
                //\trpaddfbN	Units for \trpaddbN:
                //0	Null. Ignore \trpaddbN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.
                //\trpaddflN	Units for \trpaddlN:
                //0	Null. Ignore \trpaddlN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.
                //\trpaddfrN	Units for \trpaddrN:
                //0	Null. Ignore \trpaddrN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.
                //\trpaddftN	Units for \trpaddtN:
                //0	Null. Ignore \trpaddtN in favor of \trgaphN (Word 97 style padding).
                //3	Twips.


                this._cells = new List <RTFCellDefinitionBuilder>();
                int x = 0;

                foreach (RTFCellDefinition item in this._cellDefinitions)
                {
                    item.SetX(x);
                    x += (int)(item.CellWidthRaw * TWIPSA4);
                    this._cells.Add(new RTFCellDefinitionBuilder(this._builder, this._definitionBuilder, item));
                }
                this._builder._sb.Append(this._definitionBuilder.ToString());
            }
Esempio n. 16
0
 public RTFCell(RTFBuilder builder, RTFCellDefinition cellDefinition)
 {
     this._builder            = builder;
     this._cellDefinition     = cellDefinition;
     this._firstAccessContent = true;
 }
Esempio n. 17
0
 public RTFCell(RTFBuilder builder, RTFCellDefinition cellDefinition)
 {
     this._builder = builder;
     this._cellDefinition = cellDefinition;
     this._firstAccessContent = true;
 }
Esempio n. 18
0
 public RTFImage(RTFBuilder builder)
 {
     this._builder = builder;
     this.sb       = new StringBuilder();
 }