static void Main(string[] args) { ExplorerProcess process = new ExplorerProcess(); if (args.Length < 2) { if (args.Length == 1) { try { process.OpenDocument(args[0]); } catch (Exception ex) { MessageBox.Show(ex.Message, VersionInfo.Title); return; } } Application.Run(new MainForm(process)); } else { switch (args[1]) { case "/format": process.FormatDocument(args[0]); break; default: MessageBox.Show("Invalid command: '" + args[0] + "'.", VersionInfo.Title); break; } } }
public void OnNewDocument() { this.process = this.mainForm.Process; PdfObject[] objects = this.process.Document.Internals.GetAllObjects(); this.lvObjects.Items.Clear(); for (int idx = 0; idx < objects.Length; idx++) { PdfObject obj = objects[idx]; ListViewItem item = new ListViewItem(new string[2] { PdfInternals.GetObjectID(obj).ToString(), ExplorerProcess.GetTypeName(obj) }); item.Tag = obj; this.lvObjects.Items.Add(item); } PdfPages pages = this.process.Document.Pages; this.lvPages.Items.Clear(); for (int idx = 0; idx < pages.Count; idx++) { PdfPage page = pages[idx]; ListViewItem item = new ListViewItem(new string[2] { (idx + 1).ToString(), ExplorerHelper.PageSize(page, this.mainForm.Process.IsMetric) }); //String.Format("{0:0} x {1:0} mm", XUnit.FromPoint(page.Width).Millimeter,XUnit.FromPoint(page.Height).Millimeter)}); item.Tag = page; this.lvPages.Items.Add(item); } this.process.Navigator.SetNext(this.process.Document.Info); ActivatePage("Info"); }
public MainForm(ExplorerProcess process) { this.process = process; InitializeComponent(); this.explorer = new ExplorerPanel(this); explorer.Dock = DockStyle.Fill; this.clientArea.Controls.Add(explorer); this.title = this.Text; }
internal ItemNavigator(ExplorerProcess explorer) { this.explorer = explorer; }