public MarkerWindow() : base(Gtk.WindowType.Toplevel) { Build (); rdocument = null; ndocument = null; html_document = null; AddColumns (); AddButtons (); }
public void ConstructorValid() { try { NormDocument ndoc0 = new NormDocument ("", "", "", ""); Type etype = Type.GetType ("Scielo.PDF2Text.NormDocument"); Assert.IsInstanceOfType (etype, ndoc0, "CI01"); } catch (ArgumentNullException) { Console.WriteLine ("Error: NormDocument no acepta como parametro(s) a null."); } }
private void OnNormalizeActivated(object sender, System.EventArgs e) { StyleSelectDialog dialog = new StyleSelectDialog (); if (dialog.Run () == (int) ResponseType.Ok) { try { string format = dialog.Box.ActiveText; if (format != null) { ndocument = rdocument.Normalize (format); textview.Buffer.Text = ndocument.GetText (); Normalize.Sensitive = false; } } catch (StyleException exception){ MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, exception.Message); md.Run (); md.Destroy(); }catch (NormalizerException exception){ MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, exception.Message); md.Run (); md.Destroy(); } finally { store.Clear (); DisplayMessages (); Logger.ClearList (); } } dialog.Destroy (); }
private void OnMarkupActivated(object sender, System.EventArgs e) { if (ndocument == null) { StyleSelectDialog dialog = new StyleSelectDialog (); if (dialog.Run () == (int) ResponseType.Ok) { try { string format = dialog.Box.ActiveText; if (format != null) ndocument = rdocument.Normalize (format); MarkupHTML marker = new MarkupHTML (ndocument); html_document = marker.CreateHTMLDocument (); textview.Buffer.Text = html_document.GetText (); Markup.Sensitive = false; Normalize.Sensitive = false; Preview.Sensitive = true; } catch (StyleException exception){ MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, exception.Message); md.Run (); md.Destroy(); } catch (NormalizerException exception){ MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok, exception.Message); md.Run (); md.Destroy(); } } dialog.Destroy (); } else { MarkupHTML marker = new MarkupHTML (ndocument); html_document = marker.CreateHTMLDocument (); textview.Buffer.Text = html_document.GetText (); Markup.Sensitive = false; Normalize.Sensitive = false; Preview.Sensitive = true; } }