void operation_BeginPrint(object o, BeginPrintArgs args) { dialog = new StatusDialog(Translator.GetString("Generating document"), Translator.GetHelper()); dialog.Show(); if (dialog.Cancelled) { operation.Cancelled = true; } }
void HandlePrintBeginPrint(object o, BeginPrintArgs args) { printing.NPages = pages.Count; }
void HandlePrintBeginPrint(object o, BeginPrintArgs args) { printing.NPages = 1; }
void HandleM_printBeginPrint(object o, BeginPrintArgs args) { string contents; double height; // Get the Context of the Print Operation PrintContext context = args.Context; // Get the Height of the Context height = context.Height; StringBuilder builder = new StringBuilder(); // From the FontSize and the Height of the Page determine the Lines available per page m_linesPerPage = (int)Math.Floor(height / (m_fontSize + 0.5)) - 4; int charsPerLine = 80; contents = Utilities.HTMLtoText(m_cache.LongDesc); contents = GLib.Markup.EscapeText(contents); builder.Append("<b>"); builder.Append(Utilities.getCoordString(m_cache.Lat, m_cache.Lon)); builder.Append("</b>\n"); builder.Append(Geocache.GetCTypeString(m_cache.TypeOfCache)); builder.Append("\n"); builder.Append(Catalog.GetString("<b>A cache by:</b>")); builder.Append(" "); builder.Append(m_cache.PlacedBy); builder.Append("\t"); builder.Append(Catalog.GetString("<b>Hidden on:</b>")); builder.Append(" "); builder.Append(m_cache.Time.ToShortDateString()); builder.Append("\n"); builder.Append(Catalog.GetString("<b>Cache Size:</b>")); builder.Append(" "); builder.Append(m_cache.Container); builder.Append("\t"); builder.Append(Catalog.GetString("<b>Difficulty:</b>")); builder.Append(" "); builder.Append(m_cache.Difficulty.ToString("0.0")); builder.Append("\t"); builder.Append(Catalog.GetString("<b>Terrain:</b>")); builder.Append(" "); builder.Append(m_cache.Difficulty.ToString("0.0")); builder.Append("\n\n"); if (!String.IsNullOrEmpty(m_cache.ShortDesc)) { builder.Append(Catalog.GetString("<b>Short Description:</b>")); builder.Append("\n\n"); WordWrapText(HTMLtoPango(m_cache.ShortDesc), builder, charsPerLine); builder.Append("\n\n"); } builder.Append(Catalog.GetString("<b>Long Description:</b>")); builder.Append("\n\n"); WordWrapText(HTMLtoPango(m_cache.LongDesc), builder, charsPerLine); builder.Append("\n\n"); if (!String.IsNullOrEmpty(m_cache.Notes)) { builder.Append(Catalog.GetString("<b>Notes:</b>")); builder.Append("\n\n"); builder.Append(GLib.Markup.EscapeText(m_cache.Notes)); builder.Append("\n\n"); } if (!String.IsNullOrEmpty(m_cache.Hint)) { builder.Append(Catalog.GetString("<b>Hint:</b>")); builder.Append("\n\n"); string hint = Utilities.HTMLtoText(m_cache.Hint); hint = GLib.Markup.EscapeText(hint); WordWrapText(hint, builder, charsPerLine); } contents = builder.ToString(); // Split the Content into seperate lines m_Lines = contents.Split('\n'); // Get the Number of lines m_numLines = m_Lines.Length; // Calculate the Number of Pages by how many lines there are and how many lines are available per page m_numPages = (m_numLines - 1) / m_linesPerPage + 1; // Tell the Print Operation how many pages there are m_print.NPages = m_numPages; }
private void HandlePrintBeginPrint(object o, BeginPrintArgs args) { var printOperation = (PrintOperation)o; printOperation.NPages = _pages.Count; }
void HandleBeginPrint(object o, BeginPrintArgs args) { PrintOperation op = (PrintOperation)o; op.NPages = 1; }