public void FixupReferences(EditPages Owner) { this.owner = Owner; this.BackColor = this.backColor; this.BorderColor = this.borderColor; this.DefaultPage = this.defaultPage; this.DisplayWhiteSpace = this.displayWhiteSpace; this.PageType = this.pageType; this.RulerOptions = this.rulerOptions; this.Rulers = this.rulers; this.RulerUnits = this.rulerUnits; }
public void Paint(ITextPainter Painter, Rectangle Rect, int PageIndex, int PageCount, bool PageNumbers) { System.Drawing.Font font1 = Painter.Font; Color color1 = Painter.Color; Painter.BkMode = 1; try { DrawInfo info1; Painter.Font = this.Font; Painter.Color = this.fontColor; EditPages pages1 = this.GetPages(); info1 = new DrawInfo(); info1.Init(); info1.Page = (this.page != null) ? this.page.Index : -1; SyntaxEdit edit1 = ((pages1 != null) && (pages1.Owner != null)) ? ((SyntaxEdit)pages1.Owner) : null; if ((edit1 == null) || !edit1.OnCustomDraw(Painter, Rect, DrawStage.Before, DrawState.PageHeader, info1)) { bool flag1 = ((pages1 != null) && this.reverseOnEvenPages) && (((PageIndex + 1) % 2) == 0); string text2 = PageNumbers ? ((PageIndex + 1)).ToString() : this.RightText; string text1 = flag1 ? text2 : this.LeftText; if ((text1 != null) && (text1 != string.Empty)) { Painter.TextOut(this.GetTextToPaint(text1, PageIndex, PageCount), -1, Rect); } text1 = this.CenterText; if ((text1 != null) && (text1 != string.Empty)) { text1 = this.GetTextToPaint(text1, PageIndex, PageCount); int num1 = Painter.StringWidth(text1); Painter.TextOut(text1, -1, (int)(((Rect.Left + Rect.Right) - num1) >> 1), Rect.Top); } text1 = flag1 ? this.LeftText : text2; if ((text1 != null) && (text1 != string.Empty)) { text1 = this.GetTextToPaint(text1, PageIndex, PageCount); int num2 = Painter.StringWidth(text1); Painter.TextOut(text1, -1, (int)(Rect.Right - num2), Rect.Top); } } if (edit1 != null) { edit1.OnCustomDraw(Painter, Rect, DrawStage.After, DrawState.PageHeader, info1); } } finally { Painter.BkMode = 2; Painter.Font = font1; Painter.Color = color1; } }
public string GetTextToPaint(string Text, int PageIndex, int PageCount) { MatchCollection collection1 = this.regex.Matches(Text); for (int num1 = collection1.Count - 1; num1 >= 0; num1--) { Match match1 = collection1[num1]; if (match1.Success) { string text1 = Text.Substring(match1.Index, match1.Length); if (string.Compare(text1, EditConsts.PageTag) == 0) { int num2 = PageIndex + 1; text1 = num2.ToString(); } if (string.Compare(text1, EditConsts.PagesTag) == 0) { text1 = PageCount.ToString(); } if (string.Compare(text1, EditConsts.DateTag) == 0) { text1 = DateTime.Now.ToLongDateString(); } if (string.Compare(text1, EditConsts.TimeTag) == 0) { text1 = DateTime.Now.ToLongTimeString(); } if (string.Compare(text1, EditConsts.UserTag) == 0) { text1 = Environment.UserName; } else { EditPages pages1 = this.GetPages(); if (pages1 != null) { pages1.OnDrawHeader(ref text1); } } Text = Text.Remove(match1.Index, match1.Length); Text = Text.Insert(match1.Index, text1); } } return(Text); }
// Methods public EditPage(EditPages Pages) { this.horzOffset = EditConsts.DefaultPageHorzOffset; this.vertOffset = EditConsts.DefaultPageVertOffset; this.paintNumber = true; this.startLine = 0; this.endLine = 0; this.pages = Pages; this.header = new PageHeader(this); this.footer = new PageHeader(this); this.origin = new Point(0, 0); this.pageSize = this.pages.DefaultPageSize; this.margins = new System.Drawing.Printing.Margins(this.pages.DefaultMargins.Left, this.pages.DefaultMargins.Right, this.pages.DefaultMargins.Top, this.pages.DefaultMargins.Bottom); this.pageKind = this.pages.DefaultPageKind; this.landscape = this.pages.DefaultLandscape; this.InitMargins(); this.caps = Pages.Caps; }
public XmlEditPagesInfo(EditPages Owner) : this() { this.owner = Owner; }