markus / KCOM / Controls / Sample.xaml.cs @ 3ffd4b2d
이력 | 보기 | 이력해설 | 다운로드 (43.4 KB)
1 | 787a4489 | KangIngu | using IKCOM; |
---|---|---|---|
2 | using KCOM.Common; |
||
3 | using KCOMDataModel.DataModel; |
||
4 | 5529d2a2 | humkyung | using MarkupToPDF.Controls.Parsing; |
5 | 787a4489 | KangIngu | using System; |
6 | using System.Collections.Generic; |
||
7 | using System.Collections.ObjectModel; |
||
8 | using System.ComponentModel; |
||
9 | 0c997b99 | ljiyeon | using System.Diagnostics; |
10 | 787a4489 | KangIngu | using System.Linq; |
11 | using System.Windows; |
||
12 | using System.Windows.Controls; |
||
13 | using System.Windows.Input; |
||
14 | 83a98e96 | 송근호 | using System.Windows.Media; |
15 | 787a4489 | KangIngu | using Telerik.Windows.Controls; |
16 | |||
17 | namespace KCOM.Controls |
||
18 | { |
||
19 | /// <summary> |
||
20 | /// Interaction logic for PageNavigator.xaml |
||
21 | /// </summary> |
||
22 | public partial class Sample : UserControl, INotifyPropertyChanged |
||
23 | { |
||
24 | 992a98b4 | KangIngu | public List<FAVORITE_DOC> _FavoriteSet { get; set; } |
25 | 787a4489 | KangIngu | public event PropertyChangedEventHandler PropertyChanged; |
26 | public Sample() |
||
27 | { |
||
28 | e0cfc73c | ljiyeon | //InitializeComponent(); |
29 | App.splashString(ISplashMessage.SAMPLE); |
||
30 | 0c997b99 | ljiyeon | this.Loaded += Sample_Loaded; |
31 | //_Initialize = true; |
||
32 | 90e7968d | ljiyeon | |
33 | 0c997b99 | ljiyeon | //lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged); |
34 | //ImgListbox.MouseDoubleClick += ImgListbox_MouseDoubleClick; |
||
35 | } |
||
36 | |||
37 | private void Sample_Loaded(object sender, RoutedEventArgs e) |
||
38 | { |
||
39 | afaa7c92 | djkim | if(!_Initialize) |
40 | { |
||
41 | InitializeComponent(); |
||
42 | //System.Diagnostics.Debug.WriteLine("Sample() : " + sw.ElapsedMilliseconds.ToString() + "ms"); |
||
43 | 90e7968d | ljiyeon | |
44 | afaa7c92 | djkim | _Initialize = true; |
45 | this.lstSelectComment.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(lstSelectComment_SelectionChanged); |
||
46 | this.ImgListbox.SelectionChanged += new SelectionChangedEventHandler(ImgListbox_SelectionChanged); |
||
47 | } |
||
48 | 787a4489 | KangIngu | } |
49 | |||
50 | public ObservableCollection<ThumbnailItem> _thumbnailItems; |
||
51 | private List<DOCPAGE> _PageList = null; |
||
52 | private string _DefaultUri = null; |
||
53 | public ThumbnailItem CurrentPage = null; |
||
54 | 3908a575 | humkyung | ///public ThumbnailItem _NextPage = null; |
55 | 787a4489 | KangIngu | public int PageCount = 0; |
56 | |||
57 | private bool _Initialize; |
||
58 | public event EventHandler<PageChangeEventArgs> PageChanged; |
||
59 | public event EventHandler<PageChangeEventArgs> PageChanging; |
||
60 | List<UsersCommentPagesMember> _UsersCommentPagesList = new List<UsersCommentPagesMember>(); |
||
61 | public class PageChangeEventArgs : EventArgs |
||
62 | { |
||
63 | public DOCPAGE CurrentPage { get; set; } |
||
64 | public string PageUri { get; set; } |
||
65 | public int PageNumber { get; set; } |
||
66 | } |
||
67 | |||
68 | private bool _IsFitOn { get; set; } |
||
69 | public bool IsFitOn |
||
70 | { |
||
71 | get |
||
72 | { |
||
73 | return _IsFitOn; |
||
74 | } |
||
75 | set |
||
76 | { |
||
77 | _IsFitOn = value; |
||
78 | RaisePropertyChanged("IsFitOn"); |
||
79 | } |
||
80 | } |
||
81 | |||
82 | public void RaisePropertyChanged(string propName) |
||
83 | { |
||
84 | if (PropertyChanged != null) |
||
85 | PropertyChanged(this, new PropertyChangedEventArgs(propName)); |
||
86 | } |
||
87 | |||
88 | public void SetPageNavi(List<DOCPAGE> PageList, string DefaultUri) |
||
89 | { |
||
90 | 548c696e | ljiyeon | Logger.sendCheckLog("SetPageNavi", 1); |
91 | 787a4489 | KangIngu | this._PageList = PageList; |
92 | this._DefaultUri = DefaultUri; |
||
93 | ThumbnailSet(); |
||
94 | this.PageCount = PageList.Count(); |
||
95 | //ThumbNmailSet(); |
||
96 | rdoAllPages.Checked += new RoutedEventHandler(rdoCommented_Checked); |
||
97 | rdoFavoritePages.Checked += new RoutedEventHandler(rdoFavoritePages_Checked); |
||
98 | expCommentPages.PreviewCollapsed += new Telerik.Windows.RadRoutedEventHandler(expCommentPages_PreviewCollapsed); |
||
99 | expCommentPages.PreviewExpanded += new Telerik.Windows.RadRoutedEventHandler(expCommentPages_PreviewExpanded); |
||
100 | } |
||
101 | void rdoCommented_Checked(object sender, RoutedEventArgs e) |
||
102 | { |
||
103 | 548c696e | ljiyeon | Logger.sendCheckLog("rdoCommented_Checked", 1); |
104 | 787a4489 | KangIngu | if (rdoAllPages.IsChecked == true) expCommentPages.IsExpanded = false; |
105 | SetCommentPages(); |
||
106 | } |
||
107 | |||
108 | void rdoFavoritePages_Checked(object sender, RoutedEventArgs e) |
||
109 | { |
||
110 | 548c696e | ljiyeon | Logger.sendCheckLog("rdoFavoritePages_Checked", 1); |
111 | 992a98b4 | KangIngu | if (rdoFavoritePages.IsChecked == true) |
112 | expCommentPages.IsExpanded = false; |
||
113 | |||
114 | 90e7968d | ljiyeon | _FavoriteSet = _FavoriteSet == null ? new List<FAVORITE_DOC>() : _FavoriteSet; |
115 | 992a98b4 | KangIngu | if (_FavoriteSet.Count > 0) |
116 | { |
||
117 | SetCommentPages_Favorite(); //수정 |
||
118 | } |
||
119 | else |
||
120 | { |
||
121 | rdoAllPages.IsChecked = true; |
||
122 | rdoFavoritePages.IsChecked = false; |
||
123 | } |
||
124 | } |
||
125 | |||
126 | private void SetCommentPages_Favorite() |
||
127 | { |
||
128 | 90e7968d | ljiyeon | ThumbnailSet(); |
129 | 992a98b4 | KangIngu | SetCommentPages(); |
130 | 787a4489 | KangIngu | } |
131 | 992a98b4 | KangIngu | |
132 | 787a4489 | KangIngu | void expCommentPages_PreviewCollapsed(object sender, Telerik.Windows.RadRoutedEventArgs e) |
133 | { |
||
134 | //txtThumbCount.Visibility = Visibility.Collapsed; |
||
135 | } |
||
136 | |||
137 | void expCommentPages_PreviewExpanded(object sender, Telerik.Windows.RadRoutedEventArgs e) |
||
138 | { |
||
139 | 548c696e | ljiyeon | Logger.sendCheckLog("expCommentPages_PreviewExpanded", 1); |
140 | 787a4489 | KangIngu | rdoAllPages.IsChecked = false; |
141 | rdoFavoritePages.IsChecked = false; |
||
142 | //txtThumbCount.Visibility = Visibility.Visible; |
||
143 | SetCommentPages(); |
||
144 | } |
||
145 | |||
146 | private void ImgListbox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) |
||
147 | afaa7c92 | djkim | { |
148 | 787a4489 | KangIngu | if (ImgListbox.SelectedItem != null) |
149 | { |
||
150 | 3908a575 | humkyung | int _CurrentPageNo = -1; |
151 | if (this.CurrentPage != null) _CurrentPageNo = this.CurrentPage.PageNumber; |
||
152 | 787a4489 | KangIngu | |
153 | 3908a575 | humkyung | int iPageNo = ((ImgListbox.SelectedItem as ThumbnailItem).PageNumber); |
154 | if(_CurrentPageNo != iPageNo) |
||
155 | 787a4489 | KangIngu | { |
156 | 3908a575 | humkyung | ///this.CurrentPage = this._NextPage; |
157 | ///this._NextPage = thumbnailItem; |
||
158 | PageChanging(this, new PageChangeEventArgs |
||
159 | { |
||
160 | CurrentPage = this._PageList.Where(p => p.PAGE_NUMBER == iPageNo).First(), |
||
161 | PageNumber = iPageNo, |
||
162 | PageUri = null |
||
163 | }); |
||
164 | 787a4489 | KangIngu | } |
165 | } |
||
166 | 3908a575 | humkyung | |
167 | 83a98e96 | 송근호 | var border = VisualTreeHelper.GetChild(ImgListbox, 0); |
168 | if(border!= null) |
||
169 | { |
||
170 | IEnumerable<ScrollViewer> scrollViewer = border.ChildrenOfType<ScrollViewer>(); |
||
171 | |||
172 | } |
||
173 | 787a4489 | KangIngu | } |
174 | |||
175 | public bool GotoPageFlag = false; |
||
176 | |||
177 | b2a6b24a | humkyung | /// <summary> |
178 | /// 해당 썸네일로 이동 |
||
179 | /// </summary> |
||
180 | 3908a575 | humkyung | /// <param name="_pageNumber">이동할 페이지 번호</param> |
181 | 787a4489 | KangIngu | public void GotoPage(int _pageNumber) |
182 | { |
||
183 | 90e7968d | ljiyeon | try |
184 | 787a4489 | KangIngu | { |
185 | 3908a575 | humkyung | var _page = _thumbnailItems.Where(item => item.PageNumber == _pageNumber); |
186 | if (_page.Count() > 0) |
||
187 | 787a4489 | KangIngu | { |
188 | 3908a575 | humkyung | ThumbnailItem thumbnailitem = _page.First(); |
189 | if (PageChanging != null) |
||
190 | 90e7968d | ljiyeon | { |
191 | 3908a575 | humkyung | var _itemIndex = this._thumbnailItems.IndexOf(thumbnailitem); |
192 | ImgListbox.SelectedItem = thumbnailitem; |
||
193 | |||
194 | if (_itemIndex < _thumbnailItems.Count() - 1) |
||
195 | ImgListbox.ScrollIntoView(_itemIndex); |
||
196 | else |
||
197 | ImgListbox.ScrollIntoView(this._thumbnailItems.Count() - 1); |
||
198 | 90e7968d | ljiyeon | } |
199 | 787a4489 | KangIngu | } |
200 | } |
||
201 | 90e7968d | ljiyeon | catch(Exception ex) |
202 | { |
||
203 | Logger.sendResLog("GotoPage", ex.Message, 0); |
||
204 | } |
||
205 | } |
||
206 | 787a4489 | KangIngu | |
207 | 3908a575 | humkyung | /// <summary> |
208 | /// 주어진 페이지로 변경한다 |
||
209 | /// </summary> |
||
210 | /// <param name="iPageNo">변경할 페이지 번호</param> |
||
211 | public void ChangePage(int iPageNo) |
||
212 | 787a4489 | KangIngu | { |
213 | 3908a575 | humkyung | var thumbitem = this._thumbnailItems.Where(item => item.PageNumber == iPageNo).FirstOrDefault(); |
214 | if ((PageChanged != null) && (thumbitem != null)) |
||
215 | 787a4489 | KangIngu | { |
216 | 3908a575 | humkyung | var uri = _DefaultUri.Replace("{PageNo}", thumbitem.PageNumber.ToString()); |
217 | //var _thumbitem = _thumbnailItems.Where(item => item.PageNumber == DocPage.PageNumber).First(); |
||
218 | |||
219 | var _DocPages = _PageList.Where(p => p.PAGE_NUMBER == thumbitem.PageNumber); |
||
220 | if (_DocPages.Count() > 0) |
||
221 | { |
||
222 | var _page = _DocPages.First(); |
||
223 | |||
224 | PageChanged(this, new PageChangeEventArgs |
||
225 | 787a4489 | KangIngu | { |
226 | 3908a575 | humkyung | CurrentPage = _page, |
227 | PageUri = uri, |
||
228 | PageNumber = thumbitem.PageNumber |
||
229 | 787a4489 | KangIngu | }); |
230 | 3908a575 | humkyung | ImgListbox.SelectedItem = thumbitem; |
231 | 944be2fa | djkim | this.CurrentPage = thumbitem; |
232 | 3908a575 | humkyung | } |
233 | else |
||
234 | { |
||
235 | //System.Diagnostics.Debug.WriteLine("페이지 정보가 없습니다"); |
||
236 | 787a4489 | KangIngu | } |
237 | } |
||
238 | } |
||
239 | 64f6713a | humkyung | |
240 | d974f3f8 | ljiyeon | public void GotoPageTALK(int _pageNumber, int _angle) |
241 | { |
||
242 | int _PageNo = -1; |
||
243 | |||
244 | if (int.TryParse(_pageNumber.ToString(), out _PageNo)) |
||
245 | { |
||
246 | var _page = _thumbnailItems.Where(item => item.PageNumber == _PageNo); |
||
247 | if (_page.Count() > 0) |
||
248 | { |
||
249 | ThumbnailItem _item = _page.First(); |
||
250 | setPageChangeTALK(_item, _angle); |
||
251 | this.ImgListbox.SelectedIndex = _pageNumber - 1; |
||
252 | this.ImgListbox.ScrollIntoView(_pageNumber - 1); |
||
253 | } |
||
254 | } |
||
255 | } |
||
256 | |||
257 | public void setPageChangeTALK(ThumbnailItem thumbnailItem, int _angle) |
||
258 | { |
||
259 | if (thumbnailItem != null) |
||
260 | { |
||
261 | if (PageChanging != null) |
||
262 | 90e7968d | ljiyeon | { |
263 | 3908a575 | humkyung | ///this.CurrentPage = _NextPage; |
264 | ///_NextPage = thumbnailItem; |
||
265 | d974f3f8 | ljiyeon | PageChanging(this, new PageChangeEventArgs |
266 | { |
||
267 | CurrentPage = _PageList.Where(p => p.PAGE_NUMBER == thumbnailItem.PageNumber).First(), |
||
268 | PageNumber = Convert.ToInt32(thumbnailItem.PageNumber), |
||
269 | PageUri = null |
||
270 | }); |
||
271 | |||
272 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
273 | |||
274 | var rotationNum = (_angle - instanceMain.dzMainMenu.rotate.Angle) / 90; |
||
275 | |||
276 | if (rotationNum > 0) // 1, 2, 3 |
||
277 | { |
||
278 | 90e7968d | ljiyeon | for (int i = 0; i < rotationNum; i++) |
279 | d974f3f8 | ljiyeon | { |
280 | drawingPannelRotate(true); |
||
281 | } |
||
282 | } |
||
283 | 90e7968d | ljiyeon | else if (rotationNum < 0)// -1, -2, -3 |
284 | d974f3f8 | ljiyeon | { |
285 | for (int i = 0; i < -rotationNum; i++) |
||
286 | { |
||
287 | drawingPannelRotate(false); |
||
288 | } |
||
289 | 90e7968d | ljiyeon | } |
290 | d974f3f8 | ljiyeon | } |
291 | } |
||
292 | } |
||
293 | 90e7968d | ljiyeon | |
294 | d974f3f8 | ljiyeon | public void drawingPannelRotate(bool Flag) |
295 | { |
||
296 | var instanceMain = this.ParentOfType<MainWindow>(); |
||
297 | |||
298 | if (Flag) |
||
299 | { |
||
300 | if (instanceMain.dzMainMenu.rotate.Angle == 270) |
||
301 | { |
||
302 | instanceMain.dzMainMenu.rotate.Angle = 0; |
||
303 | } |
||
304 | else |
||
305 | { |
||
306 | instanceMain.dzMainMenu.rotate.Angle += 90; |
||
307 | } |
||
308 | } |
||
309 | else |
||
310 | { |
||
311 | if (instanceMain.dzMainMenu.rotate.Angle == 0) |
||
312 | { |
||
313 | instanceMain.dzMainMenu.rotate.Angle = 270; |
||
314 | } |
||
315 | else |
||
316 | { |
||
317 | instanceMain.dzMainMenu.rotate.Angle -= 90; |
||
318 | } |
||
319 | } |
||
320 | |||
321 | if (instanceMain.dzMainMenu.zoomAndPanCanvas.Width == ViewerDataModel.Instance.ContentWidth) |
||
322 | { |
||
323 | double emptySize = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
324 | instanceMain.dzMainMenu.zoomAndPanCanvas.Width = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
325 | instanceMain.dzMainMenu.zoomAndPanCanvas.Height = emptySize; |
||
326 | } |
||
327 | 90e7968d | ljiyeon | |
328 | d974f3f8 | ljiyeon | if (instanceMain.dzMainMenu.rotate.Angle == 0) |
329 | { |
||
330 | instanceMain.dzMainMenu.translate.X = 0; |
||
331 | instanceMain.dzMainMenu.translate.Y = 0; |
||
332 | } |
||
333 | else if (instanceMain.dzMainMenu.rotate.Angle == 90) |
||
334 | { |
||
335 | instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
336 | instanceMain.dzMainMenu.translate.Y = 0; |
||
337 | } |
||
338 | else if (instanceMain.dzMainMenu.rotate.Angle == 180) |
||
339 | { |
||
340 | instanceMain.dzMainMenu.translate.X = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
341 | instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
342 | } |
||
343 | else |
||
344 | { |
||
345 | instanceMain.dzMainMenu.translate.X = 0; |
||
346 | instanceMain.dzMainMenu.translate.Y = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
347 | } |
||
348 | |||
349 | instanceMain.dzMainMenu.zoomAndPanControl.RotationAngle = instanceMain.dzMainMenu.rotate.Angle; |
||
350 | ViewerDataModel.Instance.ContentWidth = instanceMain.dzMainMenu.zoomAndPanCanvas.Width; |
||
351 | ViewerDataModel.Instance.ContentHeight = instanceMain.dzMainMenu.zoomAndPanCanvas.Height; |
||
352 | ViewerDataModel.Instance.AngleOffsetX = instanceMain.dzMainMenu.translate.X; |
||
353 | ViewerDataModel.Instance.AngleOffsetY = instanceMain.dzMainMenu.translate.Y; |
||
354 | ViewerDataModel.Instance.Angle = instanceMain.dzMainMenu.rotate.Angle; |
||
355 | |||
356 | instanceMain.dzMainMenu.pageNavigator._thumbnailItems.Where(info => info.PageNumber == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).ToList().ForEach(data => |
||
357 | { |
||
358 | data.Angle = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
||
359 | |||
360 | instanceMain.dzMainMenu.pageNavigator.ImgListbox.ItemsSource = instanceMain.dzMainMenu.pageNavigator._thumbnailItems; |
||
361 | var instance = instanceMain.dzMainMenu.CurrentDoc.docInfo.DOCPAGE.Where(p => p.PAGE_NUMBER == instanceMain.dzMainMenu.pageNavigator.CurrentPage.PageNumber).FirstOrDefault(); |
||
362 | instance.PAGE_ANGLE = int.Parse(instanceMain.dzMainMenu.rotate.Angle.ToString()); |
||
363 | |||
364 | var rotationdoc = ViewerDataModel.Instance.RotationDocs.Where(d => d.ID == instance.ID).FirstOrDefault(); |
||
365 | if (rotationdoc != null) |
||
366 | { |
||
367 | rotationdoc.PAGE_ANGLE = instance.PAGE_ANGLE; |
||
368 | } |
||
369 | else |
||
370 | { |
||
371 | ViewerDataModel.Instance.RotationDocs.Add(instance); |
||
372 | } |
||
373 | 3908a575 | humkyung | instanceMain.dzMainMenu.pageNavigator.GotoPage(data.PageNumber); |
374 | d974f3f8 | ljiyeon | }); |
375 | } |
||
376 | |||
377 | 787a4489 | KangIngu | void lstSelectComment_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) |
378 | { |
||
379 | SetCommentPages(); |
||
380 | } |
||
381 | |||
382 | |||
383 | void user_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) |
||
384 | { |
||
385 | SetCommentPages(); |
||
386 | 6c781c0c | djkim | //System.Diagnostics.Debug.WriteLine(e.PropertyName); |
387 | 787a4489 | KangIngu | } |
388 | public void SetCommentPages() |
||
389 | { |
||
390 | ThumbnailSet(); |
||
391 | SetCommentList(_UsersCommentPagesList.ToList()); |
||
392 | } |
||
393 | |||
394 | public void SetCommentList(List<UsersCommentPagesMember> UsersCommentPagesList) |
||
395 | { |
||
396 | 548c696e | ljiyeon | Logger.sendCheckLog("SetCommentList", 1); |
397 | 122914ba | ljiyeon | Logger.sendCheckLog("SetCommentList_기존 Comment 색상 제거", 1); |
398 | 787a4489 | KangIngu | #region 기존 색상 제거 작업 |
399 | foreach (var item in this._thumbnailItems) |
||
400 | { |
||
401 | item.DisplayColorItems.Clear(); |
||
402 | 122914ba | ljiyeon | } |
403 | 787a4489 | KangIngu | #endregion |
404 | |||
405 | 122914ba | ljiyeon | Logger.sendCheckLog("SetCommentList_delItem select 및 remove", 1); |
406 | 787a4489 | KangIngu | List<UsersCommentPagesMember> _delItem = new List<UsersCommentPagesMember>(); |
407 | |||
408 | _UsersCommentPagesList.ToList().ForEach(item => |
||
409 | { |
||
410 | var _comm = UsersCommentPagesList.Where(a => a.MarkupInfoID == item.MarkupInfoID); |
||
411 | |||
412 | if (_comm.Count() == 0) |
||
413 | { |
||
414 | _delItem.Add(item); |
||
415 | } |
||
416 | }); |
||
417 | |||
418 | _delItem.ForEach(f => _UsersCommentPagesList.Remove(f)); |
||
419 | |||
420 | 122914ba | ljiyeon | Logger.sendCheckLog("SetCommentList_UsersCommentPagesMember_PropertyChanged", 1); |
421 | 787a4489 | KangIngu | UsersCommentPagesList.ForEach(user => |
422 | { |
||
423 | user.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(user_PropertyChanged); |
||
424 | user.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(user_PropertyChanged); |
||
425 | |||
426 | var _commLst = _UsersCommentPagesList.Where(o => o.MarkupInfoID == user.MarkupInfoID); |
||
427 | |||
428 | if (_commLst.Count() == 0) |
||
429 | { |
||
430 | _UsersCommentPagesList.Add(user); |
||
431 | } |
||
432 | else |
||
433 | { |
||
434 | if (_commLst.First().PageNumber != user.PageNumber) |
||
435 | _commLst.First().PageNumber = user.PageNumber; |
||
436 | } |
||
437 | |||
438 | user.PageNumber.ForEach(page => |
||
439 | { |
||
440 | var _items = this._thumbnailItems.Where(item => item.PageNumber == page); |
||
441 | |||
442 | if (_items.Count() > 0) |
||
443 | _items.First().DisplayColorItems.Add(new SetColorMarkupItem { DisplayColor = user.SetColor }); |
||
444 | }); |
||
445 | }); |
||
446 | |||
447 | |||
448 | 122914ba | ljiyeon | Logger.sendCheckLog("SetCommentList_SelectComment.ItemsSource 설정", 1); |
449 | 787a4489 | KangIngu | var data = _UsersCommentPagesList.OrderByDescending(p => p.isConSolidation == Convert.ToInt32(true)).ToList(); |
450 | if (data.Count() != 0) |
||
451 | { |
||
452 | if (Convert.ToBoolean(data.First().isConSolidation)) |
||
453 | { |
||
454 | data.Where(p => p.isConSolidation == Convert.ToInt32(true)).FirstOrDefault().UserName = "Consolidated"; |
||
455 | data.Where(p => p.isConSolidation == Convert.ToInt32(true)).FirstOrDefault().Depart = ""; |
||
456 | this.lstSelectComment.ItemsSource = data; |
||
457 | } |
||
458 | else |
||
459 | { |
||
460 | this.lstSelectComment.ItemsSource = _UsersCommentPagesList; //섬네일 |
||
461 | } |
||
462 | } |
||
463 | else |
||
464 | { |
||
465 | this.lstSelectComment.ItemsSource = _UsersCommentPagesList; //섬네일 |
||
466 | } |
||
467 | //this.ImgListbox.ItemsSource = null; |
||
468 | 122914ba | ljiyeon | Logger.sendCheckLog("SetCommentList_ImgListbox 설정", 1); |
469 | 90e7968d | ljiyeon | |
470 | |||
471 | this.ImgListbox.ItemsSource = this._thumbnailItems; |
||
472 | var template = this.ImgListbox.ItemTemplate; |
||
473 | this.ImgListbox.ItemTemplate = null; |
||
474 | this.ImgListbox.ItemTemplate = template; |
||
475 | //Logger.sendCheckLog("SetCommentList_ImgListbox UpdateLayout_Start", 1); |
||
476 | //this.ImgListbox.UpdateLayout(); |
||
477 | //Logger.sendCheckLog("SetCommentList_ImgListbox UpdateLayout_End", 1); |
||
478 | |||
479 | 787a4489 | KangIngu | } |
480 | |||
481 | private void ThumbnailSet() |
||
482 | { |
||
483 | 548c696e | ljiyeon | Logger.sendCheckLog("ThumbnailSet", 1); |
484 | 787a4489 | KangIngu | if (!_Initialize) return; |
485 | |||
486 | this._thumbnailItems = new ObservableCollection<ThumbnailItem>(); |
||
487 | List<int> _selectComment = new List<int>(); |
||
488 | if (this.lstSelectComment.ItemsSource != null) |
||
489 | { |
||
490 | var _pages = from commentPage in this.lstSelectComment.ItemsSource.Cast<UsersCommentPagesMember>() |
||
491 | where commentPage.IsSelected == true |
||
492 | select commentPage.PageNumber; |
||
493 | |||
494 | foreach (var item in _pages) |
||
495 | { |
||
496 | item.ForEach(pp => _selectComment.Add(pp)); |
||
497 | } |
||
498 | |||
499 | _selectComment.Distinct(); |
||
500 | } |
||
501 | |||
502 | var uri = _DefaultUri.Replace("{0}/{1}_{2}", "8/0_0"); |
||
503 | this._PageList = this._PageList.OrderBy(data => data.PAGE_NUMBER).ToList(); |
||
504 | //this._PageList.ForEach(page => |
||
505 | ViewerDataModel.Instance.Document_Info.OrderBy(data => data.PAGE_NUMBER).ToList().ForEach(page => |
||
506 | { |
||
507 | var _pageNo = page.PAGE_NUMBER; |
||
508 | bool _addFlag = false; |
||
509 | |||
510 | 276fdd9b | KangIngu | if (rdoFavoritePages.IsChecked == false) |
511 | 787a4489 | KangIngu | { |
512 | 276fdd9b | KangIngu | if (_selectComment.Count() > 0) |
513 | 787a4489 | KangIngu | { |
514 | 276fdd9b | KangIngu | if ((rdoAllPages.IsChecked == true) |
515 | || (expCommentPages.IsExpanded == true && _selectComment.Where(s => s == _pageNo).Count() > 0)) |
||
516 | { |
||
517 | _addFlag = true; |
||
518 | } |
||
519 | 787a4489 | KangIngu | } |
520 | 276fdd9b | KangIngu | else |
521 | { |
||
522 | //if (App.ViewInfo.IsCustomPage) |
||
523 | //{ |
||
524 | // //_addFlag = false; |
||
525 | |||
526 | // //App.ViewInfo.IsCustomPage = false; |
||
527 | // //this.rdoAllPages.Visibility = System.Windows.Visibility.Collapsed; |
||
528 | // //this.lstSelectComment.Visibility = System.Windows.Visibility.Collapsed; |
||
529 | // this.rdoAllPages.IsChecked = false; |
||
530 | // this.rdoFavoritePages.IsChecked = true; |
||
531 | // //SetCommentPages(); |
||
532 | //} |
||
533 | //else |
||
534 | //{ |
||
535 | 787a4489 | KangIngu | _addFlag = true; |
536 | 276fdd9b | KangIngu | //} |
537 | } |
||
538 | 787a4489 | KangIngu | } |
539 | |||
540 | |||
541 | 90e7968d | ljiyeon | if (_addFlag) |
542 | 787a4489 | KangIngu | { |
543 | this._thumbnailItems.Add(new ThumbnailItem |
||
544 | { |
||
545 | ImageUri = new Uri(uri.Replace("{PageNo}", _pageNo.ToString())), |
||
546 | PageNumber = _pageNo, |
||
547 | Angle = page.PAGE_ANGLE, |
||
548 | }); |
||
549 | } |
||
550 | else |
||
551 | { |
||
552 | 992a98b4 | KangIngu | if ((rdoFavoritePages.IsChecked == true) && _FavoriteSet.Where(data => data.PAGE_NO == _pageNo).FirstOrDefault() != null) |
553 | { |
||
554 | this._thumbnailItems.Add(new ThumbnailItem |
||
555 | { |
||
556 | ImageUri = new Uri(uri.Replace("{PageNo}", _pageNo.ToString())), |
||
557 | PageNumber = _pageNo, |
||
558 | Angle = page.PAGE_ANGLE, |
||
559 | }); |
||
560 | } |
||
561 | 787a4489 | KangIngu | } |
562 | |||
563 | |||
564 | |||
565 | //this._thumbnailItems.Add(new ThumbnailItem |
||
566 | //{ |
||
567 | // ImageUri = new Uri(uri.Replace("{PageNo}", _pageNo.ToString())), |
||
568 | |||
569 | // //ImageUri = new Uri(@"http://www.honeyhead.net/Pages/000000/111111/11111111/1.cmp"), |
||
570 | |||
571 | // //ImageUri = new Uri(@"https://image.freepik.com/free-vector/abstract-logo-in-flame-shape_1043-44.jpg"), |
||
572 | // //DisplayColorItems = pageColor, |
||
573 | // PageNumber = Convert.ToInt32(_pageNo), |
||
574 | // Angle = Convert.ToInt32(page.PAGE_ANGLE), |
||
575 | //}); |
||
576 | }); |
||
577 | |||
578 | //txtTotPageNo.Text = this._PageList.Count().ToString(); |
||
579 | |||
580 | //txtThumbCount.Text = String.Format("Count : {0}", (this._thumbnailItems.Count).ToString()); |
||
581 | |||
582 | if (ImgListbox.ItemsSource == null) |
||
583 | { |
||
584 | ImgListbox.ItemsSource = this._thumbnailItems; |
||
585 | |||
586 | this._thumbnailItems.ToList().ForEach(data => |
||
587 | { |
||
588 | data.Width = ImgListbox.ActualWidth; |
||
589 | 5984979a | ljiyeon | data.Height = ImgListbox.ActualHeight; |
590 | 787a4489 | KangIngu | }); |
591 | |||
592 | if (ImgListbox.Items.Count > 0) |
||
593 | { |
||
594 | //int StartPageIdx = Convert.ToInt32(App.ViewInfo.StartPage) - 1; |
||
595 | int StartPageIdx = 1; |
||
596 | //if (App.ViewInfo.IsCustomPage) |
||
597 | //{ |
||
598 | // ImgListbox.SelectedItem = ImgListbox.Items.Where(data => (data as ThumbnailItem).PageNumber == Convert.ToInt32(App.ViewInfo.StartPage)).FirstOrDefault(); |
||
599 | //} |
||
600 | //else |
||
601 | //{ |
||
602 | |||
603 | if (StartPageIdx <= 0 || StartPageIdx > ImgListbox.Items.Count || StartPageIdx == 1) |
||
604 | { |
||
605 | ImgListbox.SelectedItem = ImgListbox.Items[0]; |
||
606 | } |
||
607 | else |
||
608 | { |
||
609 | ImgListbox.SelectedItem = ImgListbox.Items[StartPageIdx]; |
||
610 | } |
||
611 | //} |
||
612 | } |
||
613 | } |
||
614 | else |
||
615 | { |
||
616 | ImgListbox.UpdateLayout(); |
||
617 | ImgListbox.ItemsSource = this._thumbnailItems; |
||
618 | } |
||
619 | } |
||
620 | |||
621 | private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) |
||
622 | { |
||
623 | if (e.ClickCount >= 2) |
||
624 | { |
||
625 | var selectItem = gogogo.SelectedItem as IKCOM.MarkupItem; |
||
626 | GotoPage(selectItem.PageNumber); |
||
627 | 5529d2a2 | humkyung | var result = MarkupParser.GetBaseControl(selectItem.Data); |
628 | 90e7968d | ljiyeon | Rect rect = new Rect(new Point(result.StartPoint.X - 100, result.StartPoint.Y - 100), new Point(result.EndPoint.X + 100, result.EndPoint.Y + 100)); |
629 | 787a4489 | KangIngu | this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect); |
630 | //bool isGO = false; |
||
631 | |||
632 | //var imageViewer = this.ParentOfType<KCOM.Views.MainMenu>().imageViewer; |
||
633 | //imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Fit; |
||
634 | //imageViewer.InteractiveMode = Leadtools.Windows.Controls.InteractiveMode.UserRectangle; |
||
635 | //imageViewer.InteractiveUserRectangle += (sen, ea) => |
||
636 | //{ |
||
637 | // System.Diagnostics.Debug.WriteLine(ea.Bounds); |
||
638 | // if (ea.Status == Leadtools.Windows.Controls.InteractiveModeStatus.End) |
||
639 | // { |
||
640 | // this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(ea.Bounds); |
||
641 | // } |
||
642 | |||
643 | //}; |
||
644 | //imageViewer.SizeMode = Leadtools.Windows.Controls.SizeMode.Normal; |
||
645 | |||
646 | //GotoPage(gogogo.SelectedItem as MarkupList) |
||
647 | } |
||
648 | } |
||
649 | |||
650 | private void commentUser_SelectionChanged(object sender, SelectionChangedEventArgs e) |
||
651 | { |
||
652 | 79f3f21a | djkim | tbSearch.Text = string.Empty; |
653 | 787a4489 | KangIngu | if (e.AddedItems.Count > 0) |
654 | { |
||
655 | if (commentUser.Items.Count > 0) |
||
656 | { |
||
657 | MarkupInfoSmallList.Clear(); |
||
658 | //var d = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList.First(); |
||
659 | //d.PageNumber |
||
660 | |||
661 | //e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList.First(). |
||
662 | //gogo.DataContext = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList; |
||
663 | |||
664 | //gogogo.ItemsSource = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault().MarkupList; |
||
665 | //gogogo.ItemsSource = ViewerDataModel.Instance._markupInfoList.Where(d=>d.UserName == sender as RadCombo |
||
666 | |||
667 | var temp = e.AddedItems.Cast<MarkupInfoItem>().FirstOrDefault(); |
||
668 | d62c0439 | humkyung | var markuplist = ViewerDataModel.Instance.MyMarkupList.Where(d => d.MarkupInfoID == temp.MarkupInfoID).ToList(); |
669 | 4836261b | djkim | markuplist.ForEach(d => |
670 | 787a4489 | KangIngu | { |
671 | MarkupInfoSmallList.Add(new MarkupInfoItemSmall |
||
672 | { |
||
673 | Data = d.Data, |
||
674 | Data_Type = d.Data_Type, |
||
675 | PageNumber = d.PageNumber, |
||
676 | UserID = temp.UserID, |
||
677 | UserName = temp.UserName, |
||
678 | }); |
||
679 | }); |
||
680 | gogogo.ItemsSource = null; |
||
681 | gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList(); |
||
682 | 90e7968d | ljiyeon | |
683 | } |
||
684 | 787a4489 | KangIngu | } |
685 | else |
||
686 | { |
||
687 | MarkupInfoSmallList.Clear(); |
||
688 | ViewerDataModel.Instance._markupInfoList.ToList().ForEach(d => |
||
689 | { |
||
690 | d62c0439 | humkyung | var markuplist = ViewerDataModel.Instance.MyMarkupList.Where(u => u.MarkupInfoID == d.MarkupInfoID).ToList(); |
691 | 4836261b | djkim | |
692 | markuplist.ForEach(b => |
||
693 | 787a4489 | KangIngu | { |
694 | MarkupInfoSmallList.Add(new MarkupInfoItemSmall |
||
695 | { |
||
696 | |||
697 | Data = b.Data, |
||
698 | Data_Type = b.Data_Type, |
||
699 | PageNumber = b.PageNumber, |
||
700 | UserID = d.UserID, |
||
701 | UserName = d.UserName, |
||
702 | }); |
||
703 | }); |
||
704 | 4836261b | djkim | |
705 | 787a4489 | KangIngu | }); |
706 | gogogo.ItemsSource = null; |
||
707 | 90e7968d | ljiyeon | gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList(); |
708 | 787a4489 | KangIngu | } |
709 | } |
||
710 | |||
711 | public class MarkupInfoItemSmall |
||
712 | { |
||
713 | public string Id { get; set; } |
||
714 | public string UserName { get; set; } |
||
715 | public string UserID { get; set; } |
||
716 | public int PageNumber { get; set; } |
||
717 | public string Data { get; set; } |
||
718 | public int Data_Type { get; set; } |
||
719 | } |
||
720 | |||
721 | private List<MarkupInfoItemSmall> _MarkupInfoSmallList { get; set; } |
||
722 | public List<MarkupInfoItemSmall> MarkupInfoSmallList |
||
723 | { |
||
724 | get |
||
725 | { |
||
726 | if (_MarkupInfoSmallList == null) |
||
727 | { |
||
728 | _MarkupInfoSmallList = new List<MarkupInfoItemSmall>(); |
||
729 | } |
||
730 | return _MarkupInfoSmallList; |
||
731 | } |
||
732 | set |
||
733 | { |
||
734 | 90e7968d | ljiyeon | |
735 | 787a4489 | KangIngu | _MarkupInfoSmallList = value; |
736 | RaisePropertyChanged("MarkupInfoSmallList"); |
||
737 | } |
||
738 | } |
||
739 | |||
740 | 2aaf9645 | humkyung | /// <summary> |
741 | /// goto page and select item selected by user |
||
742 | /// </summary> |
||
743 | /// <param name="sender"></param> |
||
744 | /// <param name="e"></param> |
||
745 | 787a4489 | KangIngu | private void RadButton_Click(object sender, RoutedEventArgs e) |
746 | { |
||
747 | var clickButtonItem = sender as RadButton; |
||
748 | if (clickButtonItem != null && clickButtonItem.CommandParameter != null) |
||
749 | { |
||
750 | try |
||
751 | { |
||
752 | Rect rect = new Rect(); |
||
753 | Point s_point = new Point(); |
||
754 | Point e_point = new Point(); |
||
755 | |||
756 | MarkupInfoItemSmall gaza = clickButtonItem.CommandParameter as MarkupInfoItemSmall; |
||
757 | GotoPage(Convert.ToInt32(gaza.PageNumber)); |
||
758 | 2aaf9645 | humkyung | |
759 | 787a4489 | KangIngu | var data = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(gaza.Data.ToString()); //언패킹작업 |
760 | switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), gaza.Data_Type.ToString())) |
||
761 | { |
||
762 | case MarkupToPDF.Controls.Common.ControlType.TextControl: |
||
763 | { |
||
764 | MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data); |
||
765 | rect = new Rect(new Point(instance.StartPoint.X - 100, instance.StartPoint.Y - 100), new Point(instance.StartPoint.X + instance.BoxW + 100, instance.StartPoint.Y + instance.BoxW + 100)); |
||
766 | } |
||
767 | break; |
||
768 | case MarkupToPDF.Controls.Common.ControlType.TextBorder: |
||
769 | { |
||
770 | MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data); |
||
771 | rect = new Rect(new Point(instance.StartPoint.X - 100, instance.StartPoint.Y - 100), new Point(instance.StartPoint.X + instance.BoxW + 100, instance.StartPoint.Y + instance.BoxW + 100)); |
||
772 | } |
||
773 | break; |
||
774 | case MarkupToPDF.Controls.Common.ControlType.TextCloud: |
||
775 | { |
||
776 | MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data); |
||
777 | rect = new Rect(new Point(instance.StartPoint.X - 100, instance.StartPoint.Y - 100), new Point(instance.StartPoint.X + instance.BoxW + 100, instance.StartPoint.Y + instance.BoxW + 100)); |
||
778 | } |
||
779 | break; |
||
780 | case MarkupToPDF.Controls.Common.ControlType.PolygonControl: |
||
781 | { |
||
782 | MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data); |
||
783 | |||
784 | foreach (Point A in instance.PointSet) |
||
785 | { |
||
786 | if (s_point == new Point()) |
||
787 | { |
||
788 | s_point = A; |
||
789 | e_point = A; |
||
790 | } |
||
791 | s_point.X = Math.Min(s_point.X, A.X); |
||
792 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
793 | e_point.X = Math.Max(e_point.X, A.X); |
||
794 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
795 | } |
||
796 | rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100)); |
||
797 | } |
||
798 | break; |
||
799 | case MarkupToPDF.Controls.Common.ControlType.PolygonCloud: |
||
800 | { |
||
801 | MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data); |
||
802 | |||
803 | foreach (Point A in instance.PointSet) |
||
804 | { |
||
805 | if (s_point == new Point()) |
||
806 | { |
||
807 | s_point = A; |
||
808 | e_point = A; |
||
809 | } |
||
810 | s_point.X = Math.Min(s_point.X, A.X); |
||
811 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
812 | e_point.X = Math.Max(e_point.X, A.X); |
||
813 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
814 | } |
||
815 | rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100)); |
||
816 | } |
||
817 | break; |
||
818 | case MarkupToPDF.Controls.Common.ControlType.ChainLine: |
||
819 | { |
||
820 | MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data); |
||
821 | |||
822 | foreach (Point A in instance.PointSet) |
||
823 | { |
||
824 | if (s_point == new Point()) |
||
825 | { |
||
826 | s_point = A; |
||
827 | e_point = A; |
||
828 | } |
||
829 | s_point.X = Math.Min(s_point.X, A.X); |
||
830 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
831 | e_point.X = Math.Max(e_point.X, A.X); |
||
832 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
833 | } |
||
834 | rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100)); |
||
835 | } |
||
836 | break; |
||
837 | case MarkupToPDF.Controls.Common.ControlType.Ink: |
||
838 | { |
||
839 | MarkupToPDF.Serialize.S_Control.S_BaseControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data); |
||
840 | |||
841 | foreach (Point A in instance.PointSet) |
||
842 | { |
||
843 | if (s_point == new Point()) |
||
844 | { |
||
845 | s_point = A; |
||
846 | e_point = A; |
||
847 | } |
||
848 | s_point.X = Math.Min(s_point.X, A.X); |
||
849 | s_point.Y = Math.Min(s_point.Y, A.Y); |
||
850 | e_point.X = Math.Max(e_point.X, A.X); |
||
851 | e_point.Y = Math.Max(e_point.Y, A.Y); |
||
852 | } |
||
853 | rect = new Rect(new Point(s_point.X - 100, s_point.Y - 100), new Point(e_point.X + 100, e_point.Y + 100)); |
||
854 | } |
||
855 | break; |
||
856 | default: |
||
857 | MarkupToPDF.Serialize.S_Control.S_BaseControl item = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_BaseControl>(data); |
||
858 | rect = new Rect(new Point(item.StartPoint.X - 100, item.StartPoint.Y - 100), new Point(item.EndPoint.X + 100, item.EndPoint.Y + 100)); |
||
859 | break; |
||
860 | } |
||
861 | |||
862 | 077896be | humkyung | SelectionSet.Instance.SelectItemByRect(rect, this.ParentOfType<KCOM.Views.MainMenu>()); |
863 | 787a4489 | KangIngu | this.ParentOfType<KCOM.Views.MainMenu>().zoomAndPanControl.ZoomTo(rect); |
864 | } |
||
865 | catch (Exception ex) |
||
866 | { |
||
867 | 2aaf9645 | humkyung | this.ParentOfType<KCOM.Views.MainMenu>().DialogMessage_Alert(ex.Message, "Error"); |
868 | 787a4489 | KangIngu | } |
869 | } |
||
870 | } |
||
871 | |||
872 | private void gogogo_Loaded(object sender, RoutedEventArgs e) |
||
873 | { |
||
874 | if (MarkupInfoSmallList.Count == 0) |
||
875 | { |
||
876 | ViewerDataModel.Instance._markupInfoList.ToList().ForEach(d => |
||
877 | { |
||
878 | if (d.MarkupList != null) |
||
879 | { |
||
880 | d.MarkupList.ForEach(b => |
||
881 | { |
||
882 | MarkupInfoSmallList.Add(new MarkupInfoItemSmall |
||
883 | { |
||
884 | Id = b.ID, |
||
885 | Data = b.Data, |
||
886 | Data_Type = b.Data_Type, |
||
887 | PageNumber = b.PageNumber, |
||
888 | UserID = d.UserID, |
||
889 | UserName = d.UserName, |
||
890 | }); |
||
891 | }); |
||
892 | } |
||
893 | }); |
||
894 | gogogo.ItemsSource = null; |
||
895 | 4836261b | djkim | gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList(); |
896 | 787a4489 | KangIngu | |
897 | 90e7968d | ljiyeon | commentPage.ItemsSource = MarkupInfoSmallList.Select(d => d.PageNumber).Distinct().OrderBy(d => d).ToList(); |
898 | 787a4489 | KangIngu | commentType.ItemsSource = MarkupInfoSmallList.Select(d => d.Data_Type).Distinct().OrderBy(d => d).ToList(); |
899 | } |
||
900 | } |
||
901 | |||
902 | private void commentType_SelectionChanged(object sender, SelectionChangedEventArgs e) |
||
903 | { |
||
904 | gogogo.ItemsSource = null; |
||
905 | 79f3f21a | djkim | tbSearch.Text = string.Empty; |
906 | 90e7968d | ljiyeon | if (e.AddedItems.Count > 0) |
907 | 787a4489 | KangIngu | { |
908 | 90e7968d | ljiyeon | |
909 | 787a4489 | KangIngu | gogogo.ItemsSource = MarkupInfoSmallList.Where(d => d.Data_Type == Convert.ToInt32(e.AddedItems[0])).ToList(); |
910 | } |
||
911 | else |
||
912 | { |
||
913 | gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList(); |
||
914 | } |
||
915 | } |
||
916 | |||
917 | private void commentPage_SelectionChanged(object sender, SelectionChangedEventArgs e) |
||
918 | { |
||
919 | gogogo.ItemsSource = null; |
||
920 | 79f3f21a | djkim | tbSearch.Text = string.Empty; |
921 | 787a4489 | KangIngu | if (e.AddedItems.Count > 0) |
922 | { |
||
923 | gogogo.ItemsSource = MarkupInfoSmallList.Where(d => d.PageNumber == Convert.ToInt32(e.AddedItems[0])).ToList(); |
||
924 | } |
||
925 | else |
||
926 | { |
||
927 | gogogo.ItemsSource = MarkupInfoSmallList.OrderBy(d => d.PageNumber).ToList(); |
||
928 | } |
||
929 | } |
||
930 | |||
931 | private void btnPanorama_Click(object sender, RoutedEventArgs e) |
||
932 | { |
||
933 | ViewerDataModel.Instance.SystemMain.dzTopMenu.PanoramaShow(); |
||
934 | } |
||
935 | 79f3f21a | djkim | |
936 | private void btnSearch_Click(object sender, RoutedEventArgs e) |
||
937 | { |
||
938 | string search_str = tbSearch.Text; |
||
939 | var sel_type = commentType.SelectedItem; |
||
940 | var sel_user = commentUser.SelectedItem; |
||
941 | var sel_page = commentPage.SelectedItem; |
||
942 | List<MarkupInfoItemSmall> small_list = new List<MarkupInfoItemSmall>(); |
||
943 | List<MarkupInfoItemSmall> list = MarkupInfoSmallList; |
||
944 | 90e7968d | ljiyeon | if (sel_page != null) |
945 | 79f3f21a | djkim | { |
946 | list = list.Where(d => d.PageNumber == Convert.ToInt32(sel_page)).ToList(); |
||
947 | } |
||
948 | 90e7968d | ljiyeon | if (sel_type != null) |
949 | 79f3f21a | djkim | { |
950 | list = list.Where(d => d.Data_Type == Convert.ToInt32(sel_type)).ToList(); |
||
951 | } |
||
952 | if (sel_user != null) |
||
953 | { |
||
954 | list = list.Where(d => d.UserID == (sel_user as MarkupInfoItem).UserID).ToList(); |
||
955 | } |
||
956 | foreach (var item in list) |
||
957 | { |
||
958 | var data = MarkupToPDF.Serialize.Core.JsonSerializerHelper.UnCompressString(item.Data.ToString()); |
||
959 | 90e7968d | ljiyeon | |
960 | 79f3f21a | djkim | switch (Enum.Parse(typeof(MarkupToPDF.Controls.Common.ControlType), item.Data_Type.ToString())) |
961 | 90e7968d | ljiyeon | { |
962 | 79f3f21a | djkim | case MarkupToPDF.Controls.Common.ControlType.TextControl: |
963 | case MarkupToPDF.Controls.Common.ControlType.TextBorder: |
||
964 | case MarkupToPDF.Controls.Common.ControlType.TextCloud: |
||
965 | { |
||
966 | MarkupToPDF.Serialize.S_Control.S_TextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_TextControl>(data); |
||
967 | if (instance.Text.Contains(search_str)) |
||
968 | 90e7968d | ljiyeon | { |
969 | 79f3f21a | djkim | small_list.Add(item); |
970 | } |
||
971 | } |
||
972 | break; |
||
973 | case MarkupToPDF.Controls.Common.ControlType.ArrowTextBorderControl: |
||
974 | case MarkupToPDF.Controls.Common.ControlType.ArrowTextCloudControl: |
||
975 | case MarkupToPDF.Controls.Common.ControlType.ArrowTextControl: |
||
976 | case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextBorderControl: |
||
977 | case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextCloudControl: |
||
978 | case MarkupToPDF.Controls.Common.ControlType.ArrowTransTextControl: |
||
979 | { |
||
980 | MarkupToPDF.Serialize.S_Control.S_ArrowTextControl instance = MarkupToPDF.Serialize.Core.JsonSerializerHelper.JsonDeserialize<MarkupToPDF.Serialize.S_Control.S_ArrowTextControl>(data); |
||
981 | if (instance.ArrowText.Contains(search_str)) |
||
982 | { |
||
983 | small_list.Add(item); |
||
984 | } |
||
985 | } |
||
986 | break; |
||
987 | 90e7968d | ljiyeon | |
988 | 79f3f21a | djkim | } |
989 | 90e7968d | ljiyeon | |
990 | 79f3f21a | djkim | } |
991 | 90e7968d | ljiyeon | |
992 | 79f3f21a | djkim | gogogo.ItemsSource = null; |
993 | gogogo.ItemsSource = small_list.OrderBy(d => d.PageNumber).ToList(); |
||
994 | tbSearch.Text = string.Empty; |
||
995 | } |
||
996 | 787a4489 | KangIngu | } |
997 | } |