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