2 using System.Collections.Generic;
\r
4 using System.Windows;
\r
5 using System.Windows.Documents;
\r
6 using System.Windows.Input;
\r
11 partial class ResListAdapter : UIElementListPanel.IUIElementListAdapter
\r
13 public void urlLink_Click(object sender, RoutedEventArgs e)
\r
15 Hyperlink hl = sender as Hyperlink;
\r
19 Uri uri = hl.NavigateUri;
\r
23 string url = uri.AbsoluteUri;
\r
25 mCommand.ExecURL(url);
\r
29 public void resLink_MouseEnter(object sender, RoutedEventArgs e)
\r
31 ResViewPopup.ClearAll(ResViewPopup.CLEAR_POPUP.ALL);
\r
32 resLinkSubItem_MouseEnter(sender, e);
\r
35 void resLinkSubItem_MouseEnter(object sender, RoutedEventArgs e)
\r
37 Hyperlink hl = sender as Hyperlink;
\r
41 List<object> param = hl.Tag as List<object>;
\r
43 if (param == null || param.Count != 2)
\r
46 IThread thread = param[0] as IThread;
\r
47 int[] arrNum = param[1] as int[];
\r
48 resLinkDispalySubItem(thread, arrNum);
\r
52 public void resLinkSubItem_MouseEnter2(object sender, RoutedEventArgs e)
\r
54 Hyperlink hl = sender as Hyperlink;
\r
58 List<object> param = hl.Tag as List<object>;
\r
60 if (param == null || param.Count != 2)
\r
63 IThread thread = param[0] as IThread;
\r
64 string sArr = param[1] as string;
\r
65 //int[] arrNum = param[1] as int[];
\r
66 int[] arr = NTResViewPanel.getUtil().ParseResLinkReferenceNumber(sArr);
\r
67 resLinkDispalySubItem(thread, arr);
\r
71 public void resLinkDispalySubItem(IThread ithread, int[] arrNum)
\r
73 if (ithread == null || arrNum == null)
\r
76 List<IRes> rList = ithread.getResList();
\r
77 List<IRes> rListCopy = new List<IRes>(arrNum.Length);
\r
80 foreach (IRes res in rList)
\r
82 for (int i = seq; i < arrNum.Length; i++)
\r
84 if (res.getSequenceNo() == arrNum[i])
\r
93 FlowDocument doc = createDocument(ithread, rListCopy, false);
\r
98 if (!getZoomValue(out zoom))
\r
101 zoom = (zoom > 90) ? 90 : zoom;
\r
102 double scrHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
\r
103 ResViewPopup popup = new ResViewPopup(
\r
104 this, doc, scrHeight / 2, scrHeight * 2 / 3, zoom,
\r
105 mMainPanel.getTextSelMode());
\r
109 private bool extractParam(object sender, out IThread ithread, out IRes ires)
\r
114 Hyperlink item = sender as Hyperlink;
\r
118 List<object> list = item.Tag as List<object>;
\r
119 if (list == null || list.Count != 2)
\r
122 ithread = list[0] as IThread;
\r
123 ires = list[1] as IRes;
\r
125 return (ithread != null && ires != null);
\r
128 void hlink_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
\r
132 if (!extractParam(sender, out thread, out res))
\r
135 ResViewPopup.ClearAll(ResViewPopup.CLEAR_POPUP.ALL);
\r
136 JumpTo(res.getSequenceNo());
\r
140 void ResSeqNo_MouseLeftButtonDown(object sender, MouseEventArgs e)
\r
144 if (!extractParam(sender, out thread, out res))
\r
147 //JumpTo(thread, res.getSequenceNo());
\r
150 void ResSeqNo_MouseEnter(object sender, MouseEventArgs e)
\r
154 if (!extractParam(sender, out thread, out res))
\r
157 ResViewPopup.ClearAll(ResViewPopup.CLEAR_POPUP.ALL);
\r
159 ResViewPopup popup = new ResViewPopup(this, thread, res);
\r
162 void ResSeqNoSubItem_MouseEnter(object sender, MouseEventArgs e)
\r
166 if (!extractParam(sender, out thread, out res))
\r
169 ResViewPopup popup = new ResViewPopup(this, thread, res);
\r
174 void document_MouseMove(object sender, RoutedEventArgs e)
\r
176 ResViewPopup.ClearAll(ResViewPopup.CLEAR_POPUP.LEAVE_ONE);
\r