public override void Draw(Node node, PaintMode printMode, Color color) { if ((printMode == PaintMode.BACKGROUND)) { if (node.isVisible) { base.painter_.FillRectangle(node); } } else if ((printMode == PaintMode.FOREGROUND)) { if ((node.isVisible && (node.literalText != null)) && (node.literalText.Length > 0)) { if (node.NotBlack()) { color = node.style_.color; } base.painter_.DrawString(node, node.style_, color); } } }
public override void Draw(Node tableNode, PaintMode printMode, Color color) { if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(tableNode); } else { if (tableNode.NotBlack()) { color = tableNode.style_.color; } if (this.table.frame == TableLineStyle.SOLID) { tableNode.box.Width = this.table.totalHorzFrameSpacing; base.painter_.Rectangle(tableNode, color); tableNode.box.Width = this.table.totalWidth; } else if (this.table.frame == TableLineStyle.DASHED) { tableNode.box.Width = this.table.totalHorzFrameSpacing; base.painter_.DrawNodeRect(tableNode, color); tableNode.box.Width = this.table.totalWidth; } for (int i = 0; i < this.table.RowCount; i++) { MRow row = this.table.GetRow(i); for (int j = 0; j < row.Count; j++) { MCell cell = (MCell) row.cells[j]; int rspan = 0; int colSpan = 0; rspan = (i + cell.rowSpan) - 1; colSpan = cell.colSpan; if (rspan < (this.table.RowCount - 1)) { int x1 = 0; int x2 = 0; int y1 = 0; if (colSpan == 0) { x1 = base.rect.x; } else { x1 = (base.rect.x + this.table.spanBases[colSpan]) - (this.table.spanWidth[colSpan - 1] / 2); } if (colSpan == (this.table.ColCount - 1)) { x2 = base.rect.x + this.table.totalHorzFrameSpacing; } else { x2 = ((base.rect.x + this.table.spanBases[(colSpan + cell.columnSpan) - 1]) + this.table.spanHeight[(colSpan + cell.columnSpan) - 1]) + (this.table.spanWidth[(colSpan + cell.columnSpan) - 1] / 2); } y1 = (row.node.box.Y + this.table.rowspanWidth(i, cell.rowSpan)) + (this.table.spacingWidth[rspan] / 2); if (row.lines == TableLineStyle.SOLID) { base.painter_.DrawLine(x1, y1, x2, y1, color); } else if (row.lines == TableLineStyle.DASHED) { base.painter_.DrawDashLine(x1, y1, x2, y1, color); } } } } for (int i = 0; i < this.table.RowCount; i++) { MRow row = this.table.GetRow(i); for (int j = 0; j < row.Count; j++) { MCell cell = (MCell) row.cells[j]; int cspn = (cell.colSpan + cell.columnSpan) - 1; if (cspn < (this.table.ColCount - 1)) { int x1 = 0; int y1 = 0; int y2 = 0; int hh = 0; for (int k = 0; k < cell.rowSpan; k++) { MRow rrow = this.table.GetRow(i + k); hh += rrow.node.box.Height; if (k < (cell.rowSpan - 1)) { hh += this.table.spacingWidth[i + k]; } } x1 = ((base.rect.x + this.table.spanBases[cspn]) + this.table.spanHeight[cspn]) + (this.table.spanWidth[cspn] / 2); if (i == 0) { y1 = base.rect.y; } else { y1 = row.node.box.Y - (this.table.spacingWidth[i - 1] / 2); } if ((i + (cell.rowSpan - 1)) == (this.table.RowCount - 1)) { y2 = base.rect.y + base.rect.height; } else { y2 = (row.node.box.Y + hh) + (this.table.spacingWidth[i] / 2); } if (this.table.colLines[cspn] == TableLineStyle.SOLID) { base.painter_.DrawLine(x1, y1, x1, y2, color); } else if (this.table.colLines[cspn] == TableLineStyle.DASHED) { base.painter_.DrawDashLine(x1, y1, x1, y2, color); } } } } for (int i = 0; i < this.table.RowCount; i++) { MRow row = this.table.GetRow(i); if (row.isLabeled) { row.node.box.Width = this.table.totalWidth; } } } }
public override void Draw(Node node, PaintMode printMode, Color color) { if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(node); } else if ((printMode == PaintMode.FOREGROUND)) { int x1 = 0; int y1 = 0; int x2 = 0; int y2 = 0; int xx2 = 0; int yy2 = 0; if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(node); } else if ((printMode == PaintMode.FOREGROUND)) { Point[] points; if (node.NotBlack()) { color = node.style_.color; } if (this.lineThick_ > 1) { x1 = (((base.rect.x) + this.flineThick_) - this.dlineThick_) + 1; y1 = base.rect.y + (base.rect.height / 2); x2 = (base.rect.x) + this.elineThick_; y2 = base.rect.y + base.rect.height; xx2 = (((base.rect.x ) + this.twlineThick_) + this.lineThick_) - 1; yy2 = ((base.rect.y + this.lthick2_) + this.lineThick_) - 1; double diff1 = this.diff(x1, y1, this.aspect(x1, y1, x2, y2)); double d = this.aspect(x2, y2, xx2, yy2); double diff2 = this.diff(x2, y2, d); int num11 = 0; int num12 = 0; double num13 = 0; double num14 = 0; num13 = (diff2 - diff1) / (this.aspect(x1, y1, x2, y2) - d); num14 = (num13 * this.aspect(x1, y1, x2, y2)) + diff1; num11 = Convert.ToInt32(Math.Round(num13)); num12 = Convert.ToInt32(Math.Round(num14)); Point point9 = new Point(x1, (y1 + this.lineThick_) - 1); Point point8 = new Point(num11, num12); diff1 = this.diff((x1 + this.dlineThick_) - 1, y1, this.aspect(x1, y1, x2, y2)); diff2 = this.diff((base.rect.x ) + this.twlineThick_, base.rect.y + this.lthick2_, d); num13 = (diff2 - diff1) / (this.aspect(x1, y1, x2, y2) - d); num14 = (num13 * this.aspect(x1, y1, x2, y2)) + diff1; num11 = Convert.ToInt32(Math.Round(num13)); num12 = Convert.ToInt32(Math.Round(num14)); Point point3 = new Point(num11, num12); Point point2 = new Point((x1 + this.dlineThick_) - 1, y1); Point point10 = new Point(base.rect.x, ((base.rect.y + (base.rect.height / 2)) + this.lineThick_) - 1); Point point11 = new Point(base.rect.x, base.rect.y + (base.rect.height / 2)); Point point1 = new Point(base.rect.x, base.rect.y + (base.rect.height / 2)); Point point4 = new Point((base.rect.x) + this.twlineThick_, base.rect.y + this.lthick2_); Point point7 = new Point(((base.rect.x) + this.twlineThick_) + this.lineThick_, ((base.rect.y + this.lthick2_) + this.lineThick_) - 1); Point point5 = new Point((base.rect.x + base.rect.width) - this.spaceHeight_, base.rect.y + this.lthick2_); Point point6 = new Point((base.rect.x + base.rect.width) - this.spaceHeight_, ((base.rect.y + this.lthick2_) + this.lineThick_) - 1); points = new Point[] { point1, point2, point3, point4, point5, point6, point7, point8, point9, point10, point11 }; Point[] pointArray1 = points; base.painter_.Polyline(pointArray1, color); } else { base.painter_.DrawLine(base.rect.x, base.rect.y + (base.rect.height / 2), ((base.rect.x ) + this.flineThick_) - 1, base.rect.y + (base.rect.height / 2), color); x1 = (((base.rect.x ) + this.flineThick_) - this.dlineThick_) + 1; y1 = base.rect.y + (base.rect.height / 2); x2 = (base.rect.x ) + this.elineThick_; y2 = base.rect.y + base.rect.height; xx2 = (base.rect.x ) + this.twlineThick_; yy2 = base.rect.y + this.lthick2_; double num15 = this.aspect(x1, y1, x2, y2); double num16 = this.diff(x1, y1, num15); double num17 = this.aspect(x2, y2, xx2, yy2); double num18 = this.diff(x2, y2, num17); int num19 = 0; int num20 = 0; double num21 = 0; double num22 = 0; num21 = (num18 - num16) / (num15 - num17); num22 = (num21 * num15) + num16; num19 = Convert.ToInt32(Math.Round(num21)); num20 = Convert.ToInt32(Math.Round(num22)); Point point12 = new Point(x1, y1); Point point16 = new Point(x1, y1); Point point15 = new Point(num19, num20); num16 = this.diff((x1 + this.dlineThick_) - 1, y1, num15); num21 = (num18 - num16) / (num15 - num17); num22 = (num21 * num15) + num16; num19 = Convert.ToInt32(Math.Round(num21)); num20 = Convert.ToInt32(Math.Round(num22)); Point point14 = new Point(num19, num20); Point point13 = new Point((base.rect.x ) + this.flineThick_, y1); points = new Point[] { point12, point13, point14, point15, point16 }; base.painter_.Polyline(points, color); base.painter_.DrawLine((base.rect.x ) + this.elineThick_, base.rect.y + base.rect.height, (base.rect.x) + this.twlineThick_, base.rect.y + this.lthick2_, color); base.painter_.DrawLine((base.rect.x ) + this.twlineThick_, base.rect.y + this.lthick2_, (base.rect.x + base.rect.width) - this.spaceHeight_, base.rect.y + this.lthick2_, color); } } } }
public override void Draw(Node node, PaintMode printMode, Color color) { this.isBracketed = false; if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(node); } else if ((printMode == PaintMode.FOREGROUND)) { int x = node.box.X; int width = node.box.Width; node.box.X = x + this.lspace; node.box.Width = (width - this.lspace) - this.rspace; try { if (node.NotBlack()) { color = node.style_.color; } if (base.painter_.IsStretchy(node)) { if (base.painter_.DrawBracketed(node, color)) { this.isBracketed = true; } } else if ((node.literalText != null) && (node.literalText.Length > 0)) { base.painter_.DrawString(node, node.style_, color); } } catch { } node.box.X = x; node.box.Width = width; } }
public void DrawQuote(Node node, int x, int y, string text, int scriptLevel, StyleAttributes styleAttributes, Color color) { try { Brush brush; int width = 0; text = text.Replace("&", "&"); text = text.Replace(""", "\""); text = text.Replace("'", "'"); text = text.Replace(">", ">"); text = text.Replace("<", "<"); if (styleAttributes != null) { if (node.NotBlack() || (((node.type_.type == ElementType.Entity) && (node.parent_ != null)) && node.parent_.NotBlack())) { brush = new SolidBrush(styleAttributes.color); } else { brush = new SolidBrush(color); } } else if (color != Color.Black) { brush = new SolidBrush(color); } else { brush = this.blackBrush; } if (text == null) { return; } int len = text.Length; for (int i = 0; i < len; i++) { if (char.IsLetterOrDigit(text[i]) || char.IsPunctuation(text[i])) { string s = "" + text[i]; PointF point = new PointF((float) ((this.oX + x) + width), (float) (this.oY + y)); this.graphics_.DrawString(s, this.GetSuitableFont(node, styleAttributes), brush, point, this.typographicsFormat); width += this.MeasureWidth(node, styleAttributes, s); } else { string s = Convert.ToString(Convert.ToInt32(text[i]), 0x10).ToUpper(); s = s.PadLeft(5, '0'); Glyph glyph = this.entityManager.ByUnicode(s); if (glyph != null) { node.glyph = glyph; System.Drawing.Font f = this.MakeGlyphFont(node, scriptLevel, styleAttributes); if (f != null) { PointF point = new PointF((float) ((this.oX + x) + width), (float) (this.oY + y)); string gs = "" + glyph.CharValue; if (color == Color.Black) { this.graphics_.DrawString(gs, f, brush, point, this.typographicsFormat); } else { this.graphics_.DrawString(gs, f, new SolidBrush(color), point, this.typographicsFormat); } width += this.MeasureWidth(node, styleAttributes, gs); } node.glyph = null; } } } } catch { } }
public override void Draw(Node node, PaintMode printMode, Color color) { if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(node); } else if ((printMode == PaintMode.FOREGROUND)) { try { if (node.NotBlack()) { color = node.style_.color; } } catch { } if ((this.attrs != null) && this.isBevelled) { for (int i = 0; i < this.thick; i++) { base.painter_.DrawLine((((base.rect.x + this.beveledFirstWidth) + this.lineThick) + i) + (this.width / 4), (base.rect.y + base.rect.height) - (3 * this.lineThick), (((((base.rect.x + base.rect.width) - this.beveledWidth) - this.lineThick) - this.thick) + i) - (this.width / 4), base.rect.y + (3 * this.lineThick), 1, color); } } else { base.painter_.DrawLine(base.rect.x + (this.width / 4), base.rect.y + this.totalH, (base.rect.x + base.rect.width) - (this.width / 4), base.rect.y + this.totalH, this.thick, color); } } }
private void DrawForeground(Color color, Node node) { int x1 = 0; int y1 = 0; int x2 = 0; int y2 = 0; int num5 = 0; int num6 = 0; Point[] pointArray3; if (node.NotBlack()) { color = node.style_.color; } if (this.lineThickness > 1) { x1 = ((((base.rect.x + this.lspace_) + this.w_) + this.ddThick_) - this.doubleLineThickness) + 1; y1 = base.rect.y + (this.h_ + (this.totalThick_/2)); x2 = ((base.rect.x + this.lspace_) + this.w_) + this.ddThick2_; y2 = base.rect.y + base.rect.height; num5 = ((((base.rect.x + this.lspace_) + this.w_) + this.ddThick3_) + this.lineThickness) - 1; num6 = (((base.rect.y + this.h_) + this.lthick_) + this.lineThickness) - 1; double num7 = this.aspect(x1, y1, x2, y2); double num8 = this.diff(x1, y1, num7); double num9 = this.aspect(x2, y2, num5, num6); double num10 = this.diff(x2, y2, num9); int num11 = 0; int num12 = 0; double num13 = 0; double num14 = 0; num13 = (num10 - num8)/(num7 - num9); num14 = (num13*num7) + num8; num11 = Convert.ToInt32(Math.Round(num13)); num12 = Convert.ToInt32(Math.Round(num14)); Point point9 = new Point(x1, (y1 + this.lineThickness) - 1); Point point8 = new Point(num11, num12); num8 = this.diff((x1 + this.doubleLineThickness) - 1, y1, num7); num10 = this.diff(((base.rect.x + this.lspace_) + this.w_) + this.ddThick3_, (base.rect.y + this.h_) + this.lthick_, num9); num13 = (num10 - num8)/(num7 - num9); num14 = (num13*num7) + num8; num11 = Convert.ToInt32(Math.Round(num13)); num12 = Convert.ToInt32(Math.Round(num14)); Point point3 = new Point(num11, num12); Point point2 = new Point((x1 + this.doubleLineThickness) - 1, y1); Point point10 = new Point((base.rect.x + this.lspace_) + this.w_, (((base.rect.y + this.h_) + (this.totalThick_/2)) + this.lineThickness) - 1); Point point11 = new Point((base.rect.x + this.lspace_) + this.w_, (base.rect.y + this.h_) + (this.totalThick_/2)); Point point1 = new Point((base.rect.x + this.lspace_) + this.w_, (base.rect.y + this.h_) + (this.totalThick_/2)); Point point4 = new Point(((base.rect.x + this.lspace_) + this.w_) + this.ddThick3_, (base.rect.y + this.h_) + this.lthick_); Point point7 = new Point( (((base.rect.x + this.lspace_) + this.w_) + this.ddThick3_) + this.lineThickness, (((base.rect.y + this.h_) + this.lthick_) + this.lineThickness) - 1); Point point5 = new Point((base.rect.x + base.rect.width) - this.rspace_, (base.rect.y + this.h_) + this.lthick_); Point point6 = new Point((base.rect.x + base.rect.width) - this.rspace_, (((base.rect.y + this.h_) + this.lthick_) + this.lineThickness) - 1); pointArray3 = new Point[] {point1, point2, point3, point4, point5, point6, point7, point8, point9, point10, point11}; Point[] pointArray1 = pointArray3; base.painter_.Polyline(pointArray1, color); } else { base.painter_.DrawLine((base.rect.x + this.lspace_) + this.w_, (base.rect.y + this.h_) + (this.totalThick_/2), (((base.rect.x + this.lspace_) + this.w_) + this.ddThick_) - 1, (base.rect.y + this.h_) + (this.totalThick_/2), color); x1 = ((((base.rect.x + this.lspace_) + this.w_) + this.ddThick_) - this.doubleLineThickness) + 1; y1 = (base.rect.y + this.h_) + (this.totalThick_/2); x2 = ((base.rect.x + this.lspace_) + this.w_) + this.ddThick2_; y2 = (base.rect.y + this.h_) + this.totalThick_; num5 = ((base.rect.x + this.lspace_) + this.w_) + this.ddThick3_; num6 = (base.rect.y + this.h_) + this.lthick_; double num15 = this.aspect(x1, y1, x2, y2); double num16 = this.diff(x1, y1, num15); double num17 = this.aspect(x2, y2, num5, num6); double num18 = this.diff(x2, y2, num17); int num19 = 0; int num20 = 0; double num21 = 0; double num22 = 0; num21 = (num18 - num16)/(num15 - num17); num22 = (num21*num15) + num16; num19 = Convert.ToInt32(Math.Round(num21)); num20 = Convert.ToInt32(Math.Round(num22)); Point point12 = new Point(x1, y1); Point point16 = new Point(x1, y1); Point point15 = new Point(num19, num20); num16 = this.diff((x1 + this.doubleLineThickness) - 1, y1, num15); num21 = (num18 - num16)/(num15 - num17); num22 = (num21*num15) + num16; num19 = Convert.ToInt32(Math.Round(num21)); num20 = Convert.ToInt32(Math.Round(num22)); Point point14 = new Point(num19, num20); Point point13 = new Point(((base.rect.x + this.lspace_) + this.w_) + this.ddThick_, y1); pointArray3 = new Point[] {point12, point13, point14, point15, point16}; Point[] pointArray2 = pointArray3; base.painter_.Polyline(pointArray2, color); base.painter_.DrawLine(((base.rect.x + this.lspace_) + this.w_) + this.ddThick2_, (base.rect.y + this.h_) + this.totalThick_, ((base.rect.x + this.w_) + this.lspace_) + this.ddThick3_, (base.rect.y + this.h_) + this.lthick_, color); base.painter_.DrawLine(((base.rect.x + this.lspace_) + this.w_) + this.ddThick3_, (base.rect.y + this.h_) + this.lthick_, (base.rect.x + base.rect.width) - this.rspace_, (base.rect.y + this.h_) + this.lthick_, color); } }
public void DrawString(Node node, StyleAttributes styleAttributes, int x, int y, int dx, int dy, string text, Color color) { Brush brush1; if (styleAttributes != null) { if (node.NotBlack() || (((node.type_.type == ElementType.Entity) && (node.parent_ != null)) && node.parent_.NotBlack())) { brush1 = new SolidBrush(styleAttributes.color); } else { brush1 = new SolidBrush(color); } } else if (color != Color.Black) { brush1 = new SolidBrush(color); } else { brush1 = this.blackBrush; } System.Drawing.Font font1 = this.GetSuitableFont(node, styleAttributes); PointF tf1 = new PointF((float) ((this.oX + x) + dx), (float) ((this.oY + y) + dy)); if (((node.glyph != null) && node.glyph.IsVisible) && ((node.glyph.Category.Name != "Spaces") && (node.glyph.FontFamily.Length == 0))) { brush1 = new SolidBrush(Color.Red); this.graphics_.DrawString("?", font1, brush1, tf1, this.typographicsFormat); return; } if ((text == "{")) { try { double num3 = this.MeasureWidth(node, node.style_, text); double num4 = 0.1; double num5 = num4 * num3; tf1.X -= (int) Math.Round(num5); } catch { } } if (((node.type_.type == ElementType.Entity) && (node.glyph != null)) && (node.glyph.Code == "0222C")) { this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf1.X += node.box.Width / 3; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); goto Label_1B94; } if (((node.type_.type == ElementType.Entity) && (node.glyph != null)) && (node.glyph.Code == "000A8")) { string text1 = ""; text1 = text + text; this.graphics_.DrawString(text1, font1, brush1, tf1, this.typographicsFormat); goto Label_1B94; } if (((node.type_.type == ElementType.Entity) && (node.glyph != null)) && (node.glyph.Code == "0222D")) { this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf1.X += node.box.Width / 4; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf1.X += node.box.Width / 4; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); goto Label_1B94; } if (((node.type_.type != ElementType.Entity) || (node.glyph == null)) || (((((node.glyph.Code != "02192") && (node.glyph.Code != "02190")) && ((node.glyph.Code != "02194") && (node.glyph.Code != "0F576"))) && (((node.glyph.Code != "0F577") && (node.glyph.Code != "0F578")) && ((node.glyph.Code != "021C4") && (node.glyph.Code != "021C6")))) && ((((node.glyph.Code != "021CC") && (node.glyph.Code != "021CB")) && ((node.glyph.Code != "021C0") && (node.glyph.Code != "021C1"))) && ((((node.glyph.Code != "021BC") && (node.glyph.Code != "021BD")) && ((node.glyph.Code != "0005E") && (node.glyph.Code != "000AF"))) && (((node.glyph.Code != "0FE37") && (node.glyph.Code != "0FE38")) && (node.glyph.Code != "00332")))))) { this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); goto Label_1B94; } float single1 = node.box.Width; float single2 = node.box.Height; this.graphics_.SetClip(new Rectangle((int) tf1.X, ((int) tf1.Y) - 20, node.box.Width, node.box.Height + 40)); try { PointF tf2; SizeF ef1; if (node.glyph.Code == "0FE37") { ef1 = this.graphics_.MeasureString("D", font1, tf1, this.typographicsFormat); float single3 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single4 = ef1.Width; ef1 = this.graphics_.MeasureString("F", font1, tf1, this.typographicsFormat); float single5 = ef1.Width; ef1 = this.graphics_.MeasureString("C", font1, tf1, this.typographicsFormat); float single6 = ef1.Width; float single7 = 0f; float single8 = 0f; single8 = tf1.X; single6 -= 2f; this.graphics_.DrawString("D", font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X += single3 - 2f; single7 = single3 - 2f; int num6 = ((int) (((single1 / 2f) - (single4 / 2f)) - single3)) + 4; this.graphics_.SetClip(new Rectangle((int) tf2.X, ((int) tf2.Y) - 20, num6, node.box.Height + 40)); try { while (single7 < ((single1 / 2f) - (single4 / 2f))) { this.graphics_.DrawString("C", font1, brush1, tf2, this.typographicsFormat); tf2.X += single6; single7 += single6; } } catch { } this.graphics_.ResetClip(); tf2 = tf1; tf2.X += ((single1 / 2f) + (single4 / 2f)) - 2f; single7 = ((single1 / 2f) + (single4 / 2f)) - 2f; this.graphics_.SetClip(new Rectangle((int) tf2.X, ((int) tf2.Y) - 20, num6, node.box.Height + 40)); try { while (single7 < (single1 - single5)) { this.graphics_.DrawString("C", font1, brush1, tf2, this.typographicsFormat); tf2.X += single6; single7 += single6; } } catch { } this.graphics_.ResetClip(); tf1.X = (single8 + (single1 / 2f)) - (single4 / 2f); this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf1.X = (single8 + single1) - single5; this.graphics_.DrawString("F", font1, brush1, tf1, this.typographicsFormat); } else if (node.glyph.Code == "0FE38") { ef1 = this.graphics_.MeasureString("?", font1, tf1, this.typographicsFormat); float single9 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single10 = ef1.Width; ef1 = this.graphics_.MeasureString("A", font1, tf1, this.typographicsFormat); float single11 = ef1.Width; ef1 = this.graphics_.MeasureString("C", font1, tf1, this.typographicsFormat); float single12 = ef1.Width; float single13 = 0f; float single14 = 0f; single14 = tf1.X; single12 -= 2f; this.graphics_.DrawString("?", font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X += single9 - 2f; single13 = single9 - 2f; int num7 = ((int) (((single1 / 2f) - (single10 / 2f)) - single9)) + 4; this.graphics_.SetClip(new Rectangle((int) tf2.X, ((int) tf2.Y) - 20, num7, node.box.Height + 40)); try { while (single13 < ((single1 / 2f) - (single10 / 2f))) { this.graphics_.DrawString("C", font1, brush1, tf2, this.typographicsFormat); tf2.X += single12; single13 += single12; } } catch { } this.graphics_.ResetClip(); tf2 = tf1; tf2.X += ((single1 / 2f) + (single10 / 2f)) - 2f; single13 = ((single1 / 2f) + (single10 / 2f)) - 2f; this.graphics_.SetClip(new Rectangle((int) tf2.X, ((int) tf2.Y) - 20, num7, node.box.Height + 40)); try { while (single13 < (single1 - single11)) { this.graphics_.DrawString("C", font1, brush1, tf2, this.typographicsFormat); tf2.X += single12; single13 += single12; } } catch { } this.graphics_.ResetClip(); tf1.X = (single14 + (single1 / 2f)) - (single10 / 2f); this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf1.X = (single14 + single1) - single11; this.graphics_.DrawString("A", font1, brush1, tf1, this.typographicsFormat); } else if (node.glyph.Code == "021C4") { ef1 = this.graphics_.MeasureString("&", font1, tf1, this.typographicsFormat); float single15 = ef1.Width; ef1 = this.graphics_.MeasureString("(", font1, tf1, this.typographicsFormat); float single16 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single17 = ef1.Width; float single18 = 0f; this.graphics_.DrawString("&", font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X += single15; for (single18 = single15; single18 < (single1 - single17); single18 += single16) { this.graphics_.DrawString("(", font1, brush1, tf2, this.typographicsFormat); tf2.X += single16; } tf1.X = (tf1.X + single1) - single17; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } else if (node.glyph.Code == "021C6") { ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single19 = ef1.Width; ef1 = this.graphics_.MeasureString("(", font1, tf1, this.typographicsFormat); float single20 = ef1.Width; ef1 = this.graphics_.MeasureString(",", font1, tf1, this.typographicsFormat); float single21 = ef1.Width; float single22 = 0f; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X += single19; for (single22 = single19; single22 < (single1 - single21); single22 += single20) { this.graphics_.DrawString("(", font1, brush1, tf2, this.typographicsFormat); tf2.X += single20; } tf1.X = (tf1.X + single1) - single21; this.graphics_.DrawString(",", font1, brush1, tf1, this.typographicsFormat); } else if (node.glyph.Code == "021CC") { ef1 = this.graphics_.MeasureString("2", font1, tf1, this.typographicsFormat); float single23 = ef1.Width; ef1 = this.graphics_.MeasureString("(", font1, tf1, this.typographicsFormat); float single24 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single25 = ef1.Width; float single26 = 0f; this.graphics_.DrawString("2", font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X += single23; for (single26 = single23; single26 < (single1 - single25); single26 += single24) { this.graphics_.DrawString("(", font1, brush1, tf2, this.typographicsFormat); tf2.X += single24; } tf1.X = (tf1.X + single1) - single25; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } else if (node.glyph.Code == "021CB") { ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single27 = ef1.Width; ef1 = this.graphics_.MeasureString("(", font1, tf1, this.typographicsFormat); float single28 = ef1.Width; ef1 = this.graphics_.MeasureString("3", font1, tf1, this.typographicsFormat); float single29 = ef1.Width; float single30 = 0f; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X += single27; for (single30 = single27; single30 < (single1 - single29); single30 += single28) { this.graphics_.DrawString("(", font1, brush1, tf2, this.typographicsFormat); tf2.X += single28; } tf1.X = (tf1.X + single1) - single29; this.graphics_.DrawString("3", font1, brush1, tf1, this.typographicsFormat); } else if ((node.glyph.Code == "02192") || (node.glyph.Code == "0F577")) { ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single31 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single32 = ef1.Width; float single33 = 0f; single31 -= 1f; tf2 = tf1; while (single33 < (single1 - single32)) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X += single31; single33 += single31; } tf1.X = (tf1.X + single1) - single32; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } else { if (node.glyph.Code == "0005E") { tf2 = tf1; try { ef1 = this.graphics_.MeasureString("m", font1, tf1, this.typographicsFormat); float single34 = ef1.Width; if (single1 > (single34 * 1.1)) { float single35 = single1 / 2f; single35 = (float) Math.Round((double) single35); float single36 = single2 / 3f; single36 = (float) Math.Round((double) single36); if (single36 < 1f) { single36 = 1f; } PointF tf3 = new PointF(tf2.X, tf2.Y + single2); PointF tf4 = new PointF(tf2.X + single35, tf2.Y); PointF tf5 = new PointF(tf2.X + single1, tf2.Y + single2); PointF tf6 = new PointF(tf2.X + single35, tf2.Y + single36); GraphicsPath path1 = new GraphicsPath(); path1.AddLine(tf3, tf4); path1.AddLine(tf4, tf5); path1.AddLine(tf5, tf6); path1.AddLine(tf6, tf3); this.graphics_.FillPath(brush1, path1); goto Label_1B71; } this.graphics_.DrawString(text, font1, brush1, tf2, this.typographicsFormat); goto Label_1B71; } catch { goto Label_1B71; } } if (node.glyph.Code == "000AF") { ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single37 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single38 = ef1.Width; float single39 = 0f; tf2 = tf1; while (single39 < (single1 - single38)) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X += single37; single39 += single37; } tf1.X = (tf1.X + single1) - single38; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } else if (node.glyph.Code == "00332") { ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single40 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single41 = ef1.Width; float single42 = 0f; tf2 = tf1; while (single42 < (single1 - single41)) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X += single40; single42 += single40; } tf1.X = (tf1.X + single1) - single41; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } else if ((node.glyph.Code == "021C0") || (node.glyph.Code == "021C1")) { ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single43 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single44 = ef1.Width; float single45 = 0f; tf2 = tf1; while (single45 < (single1 - single44)) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X += single43; single45 += single43; } tf1.X = (tf1.X + single1) - single44; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } else if ((node.glyph.Code == "021BC") || (node.glyph.Code == "021BD")) { ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single46 = ef1.Width; ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single47 = ef1.Width; float single48 = 0f; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); tf2 = tf1; tf2.X = (tf2.X + single1) - single47; for (single48 = single1; single48 > single46; single48 -= single47) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X -= single47; } } else if ((node.glyph.Code == "02190") || (node.glyph.Code == "0F576")) { ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single49 = ef1.Width; ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single50 = ef1.Width; float single51 = 0f; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); single50 -= 1f; tf2 = tf1; tf2.X = (tf2.X + single1) - single50; for (single51 = single1; single51 > single49; single51 -= single50) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X -= single50; } } else if ((node.glyph.Code == "0F578") || (node.glyph.Code == "02194")) { ef1 = this.graphics_.MeasureString("!", font1, tf1, this.typographicsFormat); float single52 = ef1.Width; ef1 = this.graphics_.MeasureString("$", font1, tf1, this.typographicsFormat); float single53 = ef1.Width; ef1 = this.graphics_.MeasureString(text, font1, tf1, this.typographicsFormat); float single54 = ef1.Width; float single55 = 0f; this.graphics_.DrawString("!", font1, brush1, tf1, this.typographicsFormat); single53 -= 1f; single52 -= 1f; tf2 = tf1; tf2.X += single52; for (single55 = single52; single55 < (single1 - single54); single55 += single53) { this.graphics_.DrawString("$", font1, brush1, tf2, this.typographicsFormat); tf2.X += single53; } tf1.X = (tf1.X + single1) - single54; this.graphics_.DrawString(text, font1, brush1, tf1, this.typographicsFormat); } } } catch { } Label_1B71: this.graphics_.ResetClip(); Label_1B94: if (!node.IsUnderlined()) { return; } int num8 = (int) this.Leading((float) node.box.Height, font1); this.graphics_.DrawLine(new Pen(brush1), this.oX + node.box.X, ((this.oY + node.box.Y) + node.box.Height) - (num8 / 2), (this.oX + node.box.X) + node.box.Width, ((this.oY + node.box.Y) + node.box.Height) - (num8 / 2)); }
public override void Draw(Node node, PaintMode printMode, Color color) { if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(node); } else if ((printMode == PaintMode.FOREGROUND)) { if (node.NotBlack()) { color = node.style_.color; } if (this.attrs != null) { if (this.attrs.open.Length > 0) { base.painter_.DrawFence(node, this.attrs.open, color); } if (this.attrs.close.Length > 0) { int x = node.box.X; int w = node.box.Width; try { node.box.X = (x + w) - this.closeWidth; node.box.Width = this.closeWidth; base.painter_.DrawFence(node, this.attrs.close, color); } catch { } node.box.X = x; node.box.Width = w; } } int b = base.painter_.MeasureBaseline(node, node.style_, ","); NodesList nodesList = node.GetChildrenNodes(); if (nodesList != null) { Node next = nodesList.Next(); if (next != null) { next = nodesList.Next(); } while (next != null) { int xoff = 2; try { xoff = this.leading / 3; } catch { } if (this.Separator(next) != "") { base.painter_.DrawString(next, next.style_, (next.box.X - this.SeparatorWidth(next)) + xoff, (base.rect.y + base.rect.baseline) - b, 0, 0, this.Separator(next), color); } next = nodesList.Next(); } } } }
public override void Draw(Node node, PaintMode printMode, Color color) { if ((printMode == PaintMode.BACKGROUND)) { base.painter_.FillRectangle(node); } else if ((printMode == PaintMode.FOREGROUND)) { if (this.leftQuote.Length > 0) { base.painter_.DrawQuote(node, node.box.X, node.box.Y, this.leftQuote, node.scriptLevel_, node.style_, color); } if ((node.isVisible && (node.literalText != null)) && (node.literalText.Length > 0)) { if (node.NotBlack()) { color = node.style_.color; } int px = node.box.X; node.box.X = node.box.X + this.leftQuoteWidth; try { base.painter_.DrawString(node, node.style_, color); } catch { } node.box.X = px; } if (this.rightQuote.Length > 0) { base.painter_.DrawQuote(node, (node.box.X + node.box.Width) - this.rightQuoteWidth, node.box.Y, this.rightQuote, node.scriptLevel_, node.style_, color); } } }