Ejemplo n.º 1
0
		private void LinkWork(object sender, DoWorkEventArgs e)
		{
			BackgroundWorker worker = sender as BackgroundWorker;

			for (int k = 0; k < m_num_pages; k++)
			{
				int box_count = mu_doc.GetLinksPage(k);
				List<RectList> links = new List<RectList>();
				if (box_count > 0)
				{
					for (int j = 0; j < box_count; j++)
					{
						Point top_left;
						Size size;
						String uri;
						int type;
						int topage;

						mu_doc.GetLinkItem(j, out top_left, out size, out uri,
							out topage, out type);
						var rectlist = new RectList();
						rectlist.Height = size.Height * m_doczoom;
						rectlist.Width = size.Width * m_doczoom;
						rectlist.X = top_left.X * m_doczoom;
						rectlist.Y = top_left.Y * m_doczoom;
						rectlist.Color = m_linkcolor;
						rectlist.Index = k.ToString() + "." + j.ToString();
						rectlist.PageNum = topage;
						rectlist.Scale = m_doczoom;
						if (uri != null)
							rectlist.Urilink = new Uri(uri);
						rectlist.Type = (Link_t)type;
						links.Add(rectlist);
					}
				}
				mu_doc.ReleaseLink();
				m_page_link_list.Add(links);

				if (worker.CancellationPending == true)
				{
					e.Cancel = true;
					break;
				}
			}
		}
Ejemplo n.º 2
0
		private void SearchProgressChanged(object sender, ProgressChangedEventArgs e)
		{
			if (e.UserState == null)
			{
				/* Nothing found */
				xaml_SearchProgress.Value = e.ProgressPercentage;
			}
			else
			{
				m_text_list = new List<RectList>();
				/* found something go to page and show results */
				searchResults_t results = (searchResults_t)e.UserState;
				xaml_SearchProgress.Value = e.ProgressPercentage;
				m_currpage = results.page_found;
				/* Add in the rectangles */
				for (int kk = 0; kk < results.num_rects; kk++)
				{
					var rect_item = new RectList();
					rect_item.Scale = m_doczoom;
					rect_item.Color = m_textsearchcolor;
					rect_item.Height = results.rectangles[kk].Height * m_doczoom;
					rect_item.Width = results.rectangles[kk].Width * m_doczoom;
					rect_item.X = results.rectangles[kk].X * m_doczoom;
					rect_item.Y = results.rectangles[kk].Y * m_doczoom;
					rect_item.Index = kk.ToString();
					m_text_list.Add(rect_item);
				}
				m_docPages[results.page_found].TextBox = m_text_list;
				m_doscroll = true;
				xaml_PageList.ScrollIntoView(m_docPages[results.page_found]);
			}
		}