Beispiel #1
0
		public MainWindow()
		{
			InitializeComponent();
			this.Closing += new System.ComponentModel.CancelEventHandler(Window_Closing);
			m_file_open = false;
			m_regstartup = true;
			m_showannot = true;

			/* Allocations and set up */
			try
			{
				m_docPages = new Pages();
				m_thumbnails = new List<DocPage>();
				m_lineptrs = new List<LinesText>();
				m_textptrs = new List<BlocksText>();
				m_textset = new List<Boolean>();
				m_ghostscript = new ghostsharp();
				m_ghostscript.gsUpdateMain += new ghostsharp.gsCallBackMain(gsProgress);
				m_gsoutput = new gsOutput();
				m_gsoutput.Activate();
				m_outputintents = new OutputIntent();
				m_outputintents.Activate();
				m_ghostscript.gsIOUpdateMain += new ghostsharp.gsIOCallBackMain(gsIO);
				m_ghostscript.gsDLLProblemMain += new ghostsharp.gsDLLProblem(gsDLL);
				m_convertwin = null;
				m_extractwin = null;
				m_selection = null;
				xaml_ZoomSlider.AddHandler(MouseLeftButtonUpEvent, new MouseButtonEventHandler(ZoomReleased), true);
				xaml_PageList.AddHandler(Grid.DragOverEvent, new System.Windows.DragEventHandler(Grid_DragOver), true);
				xaml_PageList.AddHandler(Grid.DropEvent, new System.Windows.DragEventHandler(Grid_Drop), true);
				DimSelections();
				status_t result = CleanUp();

				string[] arguments = Environment.GetCommandLineArgs();
				if (arguments.Length > 1)
				{
					string filePath = arguments[1];
					ProcessFile(filePath);
				}
				else
				{
					if (m_regstartup)
						InitFromRegistry();
				}
			}
			catch (OutOfMemoryException e)
			{
				Console.WriteLine("Memory allocation failed at initialization\n");
				ShowMessage(NotifyType_t.MESS_ERROR, "Out of memory: " + e.Message);
			}
		}
Beispiel #2
0
		private void ExtractPages(object sender, RoutedEventArgs e)
		{
			if (!m_init_done || m_isXPS)
				return;

			if (m_extractwin == null || !m_extractwin.IsActive)
			{
				m_extractwin = new PageExtractSave(m_num_pages);
				m_extractwin.ExtractMain += new PageExtractSave.ExtractCallBackMain(ExtractReturn);
				m_extractwin.Activate();
				m_extractwin.Show();
			}
		}