markus / KCOM / Common / ViewerDataModel.cs @ 873011c4
이력 | 보기 | 이력해설 | 다운로드 (38.2 KB)
1 |
using KCOM.Events; |
---|---|
2 |
using KCOM.Messenger; |
3 |
using KCOMDataModel.DataModel; |
4 |
//using Leadtools; |
5 |
using MarkupToPDF.Common; |
6 |
using Newtonsoft.Json; |
7 |
using System; |
8 |
using System.Collections; |
9 |
using System.Collections.Generic; |
10 |
using System.Collections.ObjectModel; |
11 |
using System.ComponentModel; |
12 |
using System.IO; |
13 |
using System.Linq; |
14 |
using System.Text; |
15 |
using System.Threading.Tasks; |
16 |
using System.Windows; |
17 |
using System.Windows.Controls; |
18 |
using System.Windows.Ink; |
19 |
using System.Windows.Media; |
20 |
using System.Xml; |
21 |
using System.Xml.Serialization; |
22 |
//using IKCOM; |
23 |
|
24 |
namespace KCOM.Common |
25 |
{ |
26 |
public class ViewerDataModel : INotifyPropertyChanged |
27 |
{ |
28 |
|
29 |
System.Threading.CancellationTokenSource PageImageTokenSource; |
30 |
System.Threading.CancellationTokenSource MarkupTokenSource; |
31 |
|
32 |
public System.Threading.CancellationToken? PagImageCancelToken() |
33 |
{ |
34 |
return PageImageTokenSource?.Token; |
35 |
} |
36 |
|
37 |
public void PagImageCancelDispose() |
38 |
{ |
39 |
if (PageImageTokenSource != null) |
40 |
{ |
41 |
PageImageTokenSource.Dispose(); |
42 |
PageImageTokenSource = null; |
43 |
} |
44 |
} |
45 |
|
46 |
public System.Threading.CancellationToken NewPagImageCancelToken() |
47 |
{ |
48 |
if (PageImageTokenSource != null) |
49 |
{ |
50 |
System.Diagnostics.Debug.WriteLine("cancel Token"); |
51 |
PageImageTokenSource.Cancel(true); |
52 |
|
53 |
while (!PageImageTokenSource.IsCancellationRequested) |
54 |
{ |
55 |
// Do some work, or just wait |
56 |
System.Threading.Thread.Sleep(50); |
57 |
} |
58 |
} |
59 |
|
60 |
PageImageTokenSource = new System.Threading.CancellationTokenSource(); |
61 |
|
62 |
return PageImageTokenSource.Token; |
63 |
} |
64 |
|
65 |
public System.Threading.CancellationToken MarkupCancelToken() |
66 |
{ |
67 |
return MarkupTokenSource.Token; |
68 |
} |
69 |
|
70 |
public void MarkupCancelDispose() |
71 |
{ |
72 |
if (MarkupTokenSource != null) |
73 |
{ |
74 |
MarkupTokenSource.Dispose(); |
75 |
MarkupTokenSource = null; |
76 |
} |
77 |
} |
78 |
|
79 |
public System.Threading.CancellationToken NewMarkupCancelToken() |
80 |
{ |
81 |
if (MarkupTokenSource != null) |
82 |
{ |
83 |
System.Diagnostics.Debug.WriteLine("cancel Token"); |
84 |
MarkupTokenSource.Cancel(true); |
85 |
|
86 |
while (!MarkupTokenSource.IsCancellationRequested) |
87 |
{ |
88 |
// Do some work, or just wait |
89 |
System.Threading.Thread.Sleep(50); |
90 |
} |
91 |
} |
92 |
|
93 |
MarkupTokenSource = new System.Threading.CancellationTokenSource(); |
94 |
|
95 |
return MarkupTokenSource.Token; |
96 |
} |
97 |
|
98 |
|
99 |
private static DateTime KeyInputTime = DateTime.Now; |
100 |
private static TimeSpan KeyInputDelay = new TimeSpan(0, 0, 1); |
101 |
|
102 |
public bool IsFastKeyInput() |
103 |
{ |
104 |
if(DateTime.Now - KeyInputTime < KeyInputDelay) |
105 |
{ |
106 |
return true; |
107 |
} |
108 |
else |
109 |
{ |
110 |
KeyInputTime = DateTime.Now; |
111 |
return false; |
112 |
} |
113 |
} |
114 |
|
115 |
#region Data Members |
116 |
|
117 |
private static ViewerDataModel instance = new ViewerDataModel(); |
118 |
|
119 |
//private ObservableCollection<CommentUserInfo> markupControls_Pre = new ObservableCollection<CommentUserInfo>(); |
120 |
|
121 |
private ObservableCollection<CommentUserInfo> markupControls = new ObservableCollection<CommentUserInfo>(); |
122 |
private ObservableCollection<CommentUserInfo> markupControls_Sync = new ObservableCollection<CommentUserInfo>(); |
123 |
private ObservableCollection<CommentUserInfo> markupControls_User = new ObservableCollection<CommentUserInfo>(); |
124 |
|
125 |
|
126 |
////강인구 추가 |
127 |
//private List<Check_Inferface> check_Item = new List<Check_Inferface>(); |
128 |
private ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> document_Info = new ObservableCollection<KCOMDataModel.DataModel.DOCPAGE>(); |
129 |
private ObservableCollection<UndoDataGroup> undoDataList = new ObservableCollection<UndoDataGroup>(); |
130 |
|
131 |
//public UndoDataList { get; set; } |
132 |
|
133 |
|
134 |
private ObservableCollection<IKCOM.MarkupInfoItem> markupInfoList = new ObservableCollection<IKCOM.MarkupInfoItem>(); |
135 |
private ObservableCollection<MarkupUserInfo> markupUserList = new ObservableCollection<MarkupUserInfo>(); |
136 |
|
137 |
private ObservableCollection<IKCOM.MarkupInfoItem> markupInfoRevList = new ObservableCollection<IKCOM.MarkupInfoItem>(); |
138 |
|
139 |
public List<FAVORITE_DOC> FavoriteSelctedSet = new List<FAVORITE_DOC>(); |
140 |
public List<FAVORITE_DOC> FavoriteSet = new List<FAVORITE_DOC>(); |
141 |
public List<KCOMDataModel.DataModel.DOCPAGE> RotationDocs = new List<KCOMDataModel.DataModel.DOCPAGE>(); |
142 |
//_markupInfoList |
143 |
|
144 |
private StrokeCollection markupPens = new StrokeCollection(); |
145 |
|
146 |
//private ObservableCollection<RectangleData> rectangles = new ObservableCollection<RectangleData>(); |
147 |
|
148 |
|
149 |
private double contentScale = 1; |
150 |
|
151 |
private double contentOffsetY = 0; |
152 |
|
153 |
private double contentOffsetX = 0; |
154 |
|
155 |
private double Sync_contentScale = 1; |
156 |
|
157 |
private double Sync_contentOffsetY = 0; |
158 |
|
159 |
private double Sync_contentOffsetX = 0; |
160 |
|
161 |
private double contentViewportHeight = 0; |
162 |
|
163 |
private double contentViewportWidth = 0; |
164 |
|
165 |
private double contentWidth = 0; |
166 |
|
167 |
private MessageCollection _k_talkMessageSet; |
168 |
|
169 |
private double contentHeight = 0; |
170 |
|
171 |
private double markupAngle = 0; |
172 |
|
173 |
private double pageAngle = 0; |
174 |
|
175 |
private double angleOffsetX = 0; |
176 |
|
177 |
private double angleOffsetY = 0; |
178 |
|
179 |
private ImageBrush backgroundImage; |
180 |
|
181 |
//private RasterImage _rasterimage; |
182 |
|
183 |
|
184 |
#endregion Data Members |
185 |
|
186 |
#region Property Member |
187 |
|
188 |
public bool IsWheelPageChanage = false; |
189 |
|
190 |
public static ViewerDataModel Instance |
191 |
{ |
192 |
get |
193 |
{ |
194 |
return instance; |
195 |
} |
196 |
} |
197 |
|
198 |
private bool isMarkupUpdate; |
199 |
|
200 |
private bool isDownloadOriginal; |
201 |
public bool IsDownloadOriginal |
202 |
{ |
203 |
get => isDownloadOriginal; |
204 |
set |
205 |
{ |
206 |
if (isDownloadOriginal != value) |
207 |
{ |
208 |
isDownloadOriginal = value; |
209 |
OnPropertyChanged("IsDownloadOriginal"); |
210 |
} |
211 |
} |
212 |
} |
213 |
|
214 |
private bool isAdmin; |
215 |
public bool IsAdmin |
216 |
{ |
217 |
//get => true; |
218 |
get => isAdmin; |
219 |
set |
220 |
{ |
221 |
isAdmin = value; |
222 |
OnPropertyChanged("IsAdmin"); |
223 |
} |
224 |
} |
225 |
|
226 |
private bool isDocumentHistory; |
227 |
public bool IsDocumentHistory |
228 |
{ |
229 |
get => isDocumentHistory; |
230 |
set |
231 |
{ |
232 |
isDocumentHistory = value; |
233 |
OnPropertyChanged("IsDocumentHistory"); |
234 |
} |
235 |
} |
236 |
|
237 |
private bool isDownloadCancel; |
238 |
public bool IsDownloadCancel |
239 |
{ |
240 |
get => isDownloadCancel; |
241 |
set |
242 |
{ |
243 |
if (isDownloadCancel != value) |
244 |
{ |
245 |
isDownloadCancel = value; |
246 |
OnPropertyChanged("IsDownloadCancel"); |
247 |
} |
248 |
} |
249 |
} |
250 |
|
251 |
private int downloadFileProgress; |
252 |
public int DownloadFileProgress |
253 |
{ |
254 |
get => downloadFileProgress; |
255 |
set |
256 |
{ |
257 |
if (downloadFileProgress != value) |
258 |
{ |
259 |
downloadFileProgress = value; |
260 |
OnPropertyChanged("DownloadFileProgress"); |
261 |
} |
262 |
} |
263 |
} |
264 |
|
265 |
private string originalTempFile; |
266 |
public string OriginalTempFile |
267 |
{ |
268 |
get => originalTempFile; |
269 |
set |
270 |
{ |
271 |
if (originalTempFile != value) |
272 |
{ |
273 |
originalTempFile = value; |
274 |
OnPropertyChanged("OriginalTempFile"); |
275 |
} |
276 |
} |
277 |
} |
278 |
|
279 |
private List<IKCOM.MarkupItemEx> _MarkupList_MY { get; set; } |
280 |
public List<IKCOM.MarkupItemEx> MarkupList_MY |
281 |
{ |
282 |
get |
283 |
{ |
284 |
if (_MarkupList_MY == null) |
285 |
{ |
286 |
_MarkupList_MY = new List<IKCOM.MarkupItemEx>(); |
287 |
} |
288 |
|
289 |
return _MarkupList_MY; |
290 |
} |
291 |
set |
292 |
{ |
293 |
|
294 |
_MarkupList_MY = value; |
295 |
OnPropertyChanged("MarkupList_MY"); |
296 |
} |
297 |
} |
298 |
|
299 |
private List<IKCOM.MarkupItemEx> _MarkupList_USER { get; set; } |
300 |
public List<IKCOM.MarkupItemEx> MyMarkupList |
301 |
{ |
302 |
get |
303 |
{ |
304 |
if (_MarkupList_USER == null) |
305 |
{ |
306 |
_MarkupList_USER = new List<IKCOM.MarkupItemEx>(); |
307 |
} |
308 |
|
309 |
return _MarkupList_USER; |
310 |
} |
311 |
set |
312 |
{ |
313 |
|
314 |
_MarkupList_USER = value; |
315 |
OnPropertyChanged("_MarkupList_USER"); |
316 |
} |
317 |
} |
318 |
|
319 |
private List<IKCOM.MarkupItemEx> _MarkupList_Pre { get; set; } |
320 |
public List<IKCOM.MarkupItemEx> MarkupList_Pre |
321 |
{ |
322 |
get |
323 |
{ |
324 |
if (_MarkupList_Pre == null) |
325 |
{ |
326 |
_MarkupList_Pre = new List<IKCOM.MarkupItemEx>(); |
327 |
} |
328 |
|
329 |
return _MarkupList_Pre; |
330 |
} |
331 |
set |
332 |
{ |
333 |
|
334 |
_MarkupList_Pre = value; |
335 |
OnPropertyChanged("MarkupList_Pre"); |
336 |
} |
337 |
|
338 |
} |
339 |
|
340 |
private System.IO.FileInfo _searchPDF { get; set; } |
341 |
public System.IO.FileInfo searchPDF |
342 |
{ |
343 |
get |
344 |
{ |
345 |
return _searchPDF; |
346 |
} |
347 |
set |
348 |
{ |
349 |
_searchPDF = value; |
350 |
OnPropertyChanged("searchPDF"); |
351 |
} |
352 |
} |
353 |
|
354 |
|
355 |
/// <summary> |
356 |
/// 현재 상단 메뉴에서 선택된 컨트롤 |
357 |
/// </summary> |
358 |
private string _SelectedControl { get; set; } |
359 |
public string SelectedControl |
360 |
{ |
361 |
get |
362 |
{ |
363 |
return _SelectedControl; |
364 |
} |
365 |
set |
366 |
{ |
367 |
_SelectedControl = value; |
368 |
OnPropertyChanged("SelectedControl"); |
369 |
} |
370 |
} |
371 |
|
372 |
private List<KCOM.Common.MacroItem> _MacroItems; |
373 |
|
374 |
public List<KCOM.Common.MacroItem> MacroItems |
375 |
{ |
376 |
get |
377 |
{ |
378 |
return _MacroItems; |
379 |
} |
380 |
|
381 |
set |
382 |
{ |
383 |
_MacroItems = value; |
384 |
} |
385 |
} |
386 |
|
387 |
private int _MacroCommandIndex; |
388 |
|
389 |
public int MacroCommandIndex |
390 |
{ |
391 |
get |
392 |
{ |
393 |
return _MacroCommandIndex; |
394 |
} |
395 |
|
396 |
set |
397 |
{ |
398 |
_MacroCommandIndex = value; |
399 |
} |
400 |
} |
401 |
|
402 |
private bool _IsMacroCommand; |
403 |
|
404 |
public bool IsMacroCommand |
405 |
{ |
406 |
get |
407 |
{ |
408 |
return _IsMacroCommand; |
409 |
} |
410 |
|
411 |
set |
412 |
{ |
413 |
_IsMacroCommand = value; |
414 |
} |
415 |
} |
416 |
|
417 |
/// <summary> |
418 |
/// 현재 상단 메뉴의 선 굵기값 |
419 |
/// </summary> |
420 |
private double _LineSize { get; set; } |
421 |
public double LineSize |
422 |
{ |
423 |
get |
424 |
{ |
425 |
return _LineSize; |
426 |
} |
427 |
set |
428 |
{ |
429 |
_LineSize = value; |
430 |
OnPropertyChanged("LineSize"); |
431 |
} |
432 |
} |
433 |
|
434 |
private double _Interval { get; set; } |
435 |
public double Interval |
436 |
{ |
437 |
get |
438 |
{ |
439 |
return _Interval; |
440 |
} |
441 |
set |
442 |
{ |
443 |
_Interval = value; |
444 |
OnPropertyChanged("Interval"); |
445 |
} |
446 |
} |
447 |
private double _SaveInterval { get; set; } |
448 |
public double SaveInterval |
449 |
{ |
450 |
get |
451 |
{ |
452 |
return _SaveInterval; |
453 |
} |
454 |
set |
455 |
{ |
456 |
_SaveInterval = value; |
457 |
OnPropertyChanged("SaveInterval"); |
458 |
} |
459 |
} |
460 |
private double _ArcLength { get; set; } |
461 |
public double ArcLength |
462 |
{ |
463 |
get |
464 |
{ |
465 |
return _ArcLength; |
466 |
} |
467 |
set |
468 |
{ |
469 |
_ArcLength = value; |
470 |
OnPropertyChanged("ArcLength"); |
471 |
} |
472 |
} |
473 |
|
474 |
public bool IsPressShift |
475 |
{ |
476 |
get |
477 |
{ |
478 |
return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Shift) == System.Windows.Input.ModifierKeys.Shift); |
479 |
} |
480 |
} |
481 |
|
482 |
public bool IsPressCtrl |
483 |
{ |
484 |
get |
485 |
{ |
486 |
return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Control) == System.Windows.Input.ModifierKeys.Control); |
487 |
} |
488 |
} |
489 |
|
490 |
/// <summary> |
491 |
/// Dash 사이즈 |
492 |
/// </summary> |
493 |
private DoubleCollection _DashSize { get; set; } |
494 |
public DoubleCollection DashSize |
495 |
{ |
496 |
get |
497 |
{ |
498 |
return _DashSize; |
499 |
} |
500 |
set |
501 |
{ |
502 |
_DashSize = value; |
503 |
OnPropertyChanged("DashSize"); |
504 |
} |
505 |
} |
506 |
|
507 |
private string _ControlTag { get; set; } |
508 |
public string ControlTag |
509 |
{ |
510 |
get |
511 |
{ |
512 |
return _ControlTag; |
513 |
} |
514 |
set |
515 |
{ |
516 |
_ControlTag = value; |
517 |
OnPropertyChanged("ControlTag"); |
518 |
} |
519 |
} |
520 |
|
521 |
private string _CheckStatus { get; set; } |
522 |
public string CheckStatus |
523 |
{ |
524 |
get |
525 |
{ |
526 |
return _CheckStatus; |
527 |
} |
528 |
set |
529 |
{ |
530 |
_CheckStatus = value; |
531 |
OnPropertyChanged("CheckStatus"); |
532 |
} |
533 |
} |
534 |
|
535 |
|
536 |
|
537 |
//private bool _IsPageChanged { get; set; } |
538 |
//public bool IsPageChanged |
539 |
//{ |
540 |
// get |
541 |
// { |
542 |
// return _IsPageChanged; |
543 |
// } |
544 |
// set |
545 |
// { |
546 |
// _IsPageChanged = value; |
547 |
// OnPropertyChanged("IsPageChanged"); |
548 |
// } |
549 |
//} |
550 |
|
551 |
|
552 |
|
553 |
///// <summary> |
554 |
///// 강인구 추가(Check List관련) |
555 |
///// </summary> |
556 |
//public List<Check_Inferface> Check_Item |
557 |
//{ |
558 |
// get |
559 |
// { |
560 |
// return check_Item; |
561 |
// } |
562 |
//} |
563 |
|
564 |
private bool _IsConsolidate { get; set; } |
565 |
public bool IsConsolidate |
566 |
{ |
567 |
get |
568 |
{ |
569 |
return _IsConsolidate; |
570 |
} |
571 |
set |
572 |
{ |
573 |
_IsConsolidate = value; |
574 |
OnPropertyChanged("IsConsolidate"); |
575 |
} |
576 |
} |
577 |
|
578 |
private bool _IsFinalPDF { get; set; } |
579 |
public bool IsFinalPDF |
580 |
{ |
581 |
get |
582 |
{ |
583 |
return _IsFinalPDF; |
584 |
} |
585 |
set |
586 |
{ |
587 |
_IsFinalPDF = value; |
588 |
OnPropertyChanged("IsFinalPDF"); |
589 |
} |
590 |
} |
591 |
private DateTime _FinalPDFTime { get; set; } |
592 |
public DateTime FinalPDFTime |
593 |
{ |
594 |
get |
595 |
{ |
596 |
return _FinalPDFTime; |
597 |
} |
598 |
set |
599 |
{ |
600 |
_FinalPDFTime = value; |
601 |
OnPropertyChanged("FinalPDFTime"); |
602 |
} |
603 |
} |
604 |
|
605 |
//////////////////////////////////////////////// |
606 |
|
607 |
|
608 |
#region Angle 관련 |
609 |
private Visibility _MarkupAngleVisibility { get; set; } |
610 |
public Visibility MarkupAngleVisibility |
611 |
{ |
612 |
get |
613 |
{ |
614 |
return _MarkupAngleVisibility; |
615 |
} |
616 |
set |
617 |
{ |
618 |
_MarkupAngleVisibility = value; |
619 |
OnPropertyChanged("MarkupAngleVisibility"); |
620 |
} |
621 |
|
622 |
} |
623 |
|
624 |
public double MarkupAngle |
625 |
{ |
626 |
get |
627 |
{ |
628 |
return markupAngle; |
629 |
} |
630 |
set |
631 |
{ |
632 |
markupAngle = value; |
633 |
OnPropertyChanged("MarkupAngle"); |
634 |
} |
635 |
} |
636 |
|
637 |
public double PageAngle |
638 |
{ |
639 |
get |
640 |
{ |
641 |
return pageAngle; |
642 |
} |
643 |
set |
644 |
{ |
645 |
pageAngle = value; |
646 |
OnPropertyChanged("PageAngle"); |
647 |
} |
648 |
} |
649 |
|
650 |
private string _HelperContent { get; set; } |
651 |
public string HelperContent |
652 |
{ |
653 |
get |
654 |
{ |
655 |
return _HelperContent; |
656 |
} |
657 |
set |
658 |
{ |
659 |
_HelperContent = value; |
660 |
OnPropertyChanged("HelperContent"); |
661 |
} |
662 |
} |
663 |
|
664 |
private string _HelperHeader { get; set; } |
665 |
public string HelperHeader |
666 |
{ |
667 |
get |
668 |
{ |
669 |
return _HelperHeader; |
670 |
} |
671 |
set |
672 |
{ |
673 |
_HelperHeader = value; |
674 |
OnPropertyChanged("HelperHeader"); |
675 |
} |
676 |
} |
677 |
|
678 |
private bool _HelperExit { get; set; } |
679 |
public bool HelperExit |
680 |
{ |
681 |
get |
682 |
{ |
683 |
return _HelperExit; |
684 |
} |
685 |
set |
686 |
{ |
687 |
_HelperExit = value; |
688 |
OnPropertyChanged("HelperExit"); |
689 |
} |
690 |
} |
691 |
|
692 |
#endregion |
693 |
|
694 |
public event EventHandler<EventArgs> PageLoaded; |
695 |
|
696 |
/// <summary> |
697 |
/// 페이지 변경 후 페이지에 해당하는 마크업을 모두 읽었을때 이벤트를 보내도록 한다. |
698 |
/// </summary> |
699 |
public void LoadPageMarkupFinish(Rect rect) |
700 |
{ |
701 |
if(PageLoaded != null) |
702 |
{ |
703 |
PageLoaded(this, new EventArgs()); |
704 |
} |
705 |
else |
706 |
{ |
707 |
this.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(rect); |
708 |
} |
709 |
} |
710 |
|
711 |
public bool SaveCheck() |
712 |
{ |
713 |
bool result = false; |
714 |
|
715 |
if (ViewerDataModel.Instance.UndoDataList.Count > 0) |
716 |
{ |
717 |
DateTime undoTime = UndoDataList.OrderByDescending(order => order.EventTime).FirstOrDefault().EventTime; |
718 |
DateTime updatetime = DateTime.Now.AddDays(-1); |
719 |
|
720 |
if (_markupInfoList.Count > 0) |
721 |
{ |
722 |
updatetime = _markupInfoList.OrderByDescending(order => order.UpdateTime).FirstOrDefault().UpdateTime; |
723 |
} |
724 |
|
725 |
if (undoTime > updatetime) |
726 |
{ |
727 |
result = false; |
728 |
} |
729 |
else |
730 |
{ |
731 |
result = true; |
732 |
} |
733 |
} |
734 |
else |
735 |
{ |
736 |
result = true; |
737 |
} |
738 |
|
739 |
return result; |
740 |
} |
741 |
|
742 |
public bool FinalPDFCheck() |
743 |
{ |
744 |
bool result = false; |
745 |
|
746 |
DateTime updatetime = DateTime.Now.AddDays(-1); |
747 |
|
748 |
if (_markupInfoList.Count > 0) |
749 |
{ |
750 |
var consolidateItems = _markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0); |
751 |
|
752 |
if (consolidateItems.Count() > 0) |
753 |
{ |
754 |
updatetime = consolidateItems.OrderByDescending(order => order.UpdateTime).FirstOrDefault().UpdateTime; |
755 |
} |
756 |
} |
757 |
|
758 |
if (FinalPDFTime > updatetime) |
759 |
{ |
760 |
result = true; |
761 |
} |
762 |
|
763 |
return result; |
764 |
} |
765 |
|
766 |
public void SetAngleVisible(Visibility visibility) |
767 |
{ |
768 |
this.MarkupAngleVisibility = visibility; |
769 |
} |
770 |
|
771 |
|
772 |
public ObservableCollection<CommentUserInfo> MarkupControls |
773 |
{ |
774 |
get |
775 |
{ |
776 |
return markupControls; |
777 |
} |
778 |
} |
779 |
|
780 |
public ObservableCollection<CommentUserInfo> MarkupControls_Sync |
781 |
{ |
782 |
get |
783 |
{ |
784 |
return markupControls_Sync; |
785 |
} |
786 |
} |
787 |
public int current_page_commentcnt = 0; |
788 |
public ObservableCollection<CommentUserInfo> MarkupControls_USER |
789 |
{ |
790 |
get |
791 |
{ |
792 |
return markupControls_User; |
793 |
} |
794 |
} |
795 |
|
796 |
public ObservableCollection<UndoDataGroup> UndoDataList |
797 |
{ |
798 |
get |
799 |
{ |
800 |
return undoDataList; |
801 |
} |
802 |
} |
803 |
|
804 |
public StrokeCollection MarkupPens |
805 |
{ |
806 |
get |
807 |
{ |
808 |
return markupPens; |
809 |
} |
810 |
|
811 |
} |
812 |
|
813 |
#region 버튼 여부 |
814 |
|
815 |
/// <summary> |
816 |
/// 상단 Fill 버튼이 클릭 되어있는지 |
817 |
/// </summary> |
818 |
private bool _checkFillShape { get; set; } |
819 |
public bool checkFillShape |
820 |
{ |
821 |
get |
822 |
{ |
823 |
return _checkFillShape; |
824 |
} |
825 |
set |
826 |
{ |
827 |
_checkFillShape = value; |
828 |
OnPropertyChanged("checkFillShape"); |
829 |
} |
830 |
} |
831 |
|
832 |
/// <summary> |
833 |
/// 상단 Hatch 버튼이 클릭 되어있는지 |
834 |
/// </summary> |
835 |
private bool _checkHatchShape { get; set; } |
836 |
public bool checkHatchShape |
837 |
{ |
838 |
get |
839 |
{ |
840 |
return _checkHatchShape; |
841 |
} |
842 |
set |
843 |
{ |
844 |
_checkHatchShape = value; |
845 |
OnPropertyChanged("checkHatchShape"); |
846 |
} |
847 |
} |
848 |
|
849 |
private double _controlOpacity { get; set; } |
850 |
public double ControlOpacity |
851 |
{ |
852 |
get |
853 |
{ |
854 |
return _controlOpacity; |
855 |
} |
856 |
set |
857 |
{ |
858 |
|
859 |
_controlOpacity = value; |
860 |
OnPropertyChanged("ControlOpacity"); |
861 |
} |
862 |
} |
863 |
|
864 |
private MarkupToPDF.Controls.Common.PaintSet _paintSet { get; set; } |
865 |
public MarkupToPDF.Controls.Common.PaintSet paintSet |
866 |
{ |
867 |
get |
868 |
{ |
869 |
return _paintSet; |
870 |
} |
871 |
set |
872 |
{ |
873 |
_paintSet = value; |
874 |
OnPropertyChanged("paintSet"); |
875 |
} |
876 |
} |
877 |
|
878 |
/// <summary> |
879 |
/// 강인구 추가 |
880 |
/// 상단 TextStyle 버튼이 클릭 되어있는지 |
881 |
/// </summary> |
882 |
private bool _checkTextStyle { get; set; } |
883 |
public bool checkTextStyle |
884 |
{ |
885 |
get |
886 |
{ |
887 |
return _checkTextStyle; |
888 |
} |
889 |
set |
890 |
{ |
891 |
_checkTextStyle = value; |
892 |
OnPropertyChanged("checkTextStyle"); |
893 |
} |
894 |
} |
895 |
|
896 |
/// <summary> |
897 |
/// 강인구 추가 |
898 |
/// 상단 TextWeight 버튼이 클릭 되어있는지 |
899 |
/// </summary> |
900 |
private bool _checkTextWeight { get; set; } |
901 |
public bool checkTextWeight |
902 |
{ |
903 |
get |
904 |
{ |
905 |
return _checkTextWeight; |
906 |
} |
907 |
set |
908 |
{ |
909 |
_checkTextWeight = value; |
910 |
OnPropertyChanged("checkTextWeight"); |
911 |
} |
912 |
} |
913 |
|
914 |
/// <summary> |
915 |
/// 강인구 추가 |
916 |
/// 상단 UnderLine 버튼이 클릭 되어있는지 |
917 |
/// </summary> |
918 |
private bool _checkUnderLine { get; set; } |
919 |
public bool checkUnderLine |
920 |
{ |
921 |
get |
922 |
{ |
923 |
return _checkUnderLine; |
924 |
} |
925 |
set |
926 |
{ |
927 |
_checkUnderLine = value; |
928 |
OnPropertyChanged("checkUnderLine"); |
929 |
} |
930 |
} |
931 |
|
932 |
/// <summary> |
933 |
/// 상단 Hatch 버튼이 클릭 되어있는지 |
934 |
/// </summary> |
935 |
private bool _checkHighShape { get; set; } |
936 |
public bool checkHighShape |
937 |
{ |
938 |
get |
939 |
{ |
940 |
return _checkHighShape; |
941 |
} |
942 |
set |
943 |
{ |
944 |
_checkHighShape = value; |
945 |
OnPropertyChanged("checkHighShape"); |
946 |
} |
947 |
} |
948 |
|
949 |
/// <summary> |
950 |
/// 상단 Axis 버튼이 클릭 되어있는지 |
951 |
/// </summary> |
952 |
private bool _IsAxisLock { get; set; } |
953 |
public bool IsAxisLock |
954 |
{ |
955 |
get |
956 |
{ |
957 |
return _IsAxisLock; |
958 |
} |
959 |
set |
960 |
{ |
961 |
_IsAxisLock = value; |
962 |
OnPropertyChanged("IsAxisLock"); |
963 |
} |
964 |
} |
965 |
|
966 |
/// <summary> |
967 |
/// 상단 Highlight 버튼이 클릭 되어있는지 |
968 |
/// </summary> |
969 |
private bool _checkHighlight { get; set; } |
970 |
public bool checkHighlight |
971 |
{ |
972 |
get |
973 |
{ |
974 |
return _checkHighlight; |
975 |
} |
976 |
set |
977 |
{ |
978 |
_checkHighlight = value; |
979 |
OnPropertyChanged("checkHighlight"); |
980 |
} |
981 |
} |
982 |
|
983 |
/// <summary> |
984 |
/// 강인구 추가 |
985 |
/// 상단 TextWeight 버튼이 클릭 되어있는지 |
986 |
/// </summary> |
987 |
private double _TextSize { get; set; } |
988 |
public double TextSize |
989 |
{ |
990 |
get |
991 |
{ |
992 |
return _TextSize; |
993 |
} |
994 |
set |
995 |
{ |
996 |
_TextSize = value; |
997 |
OnPropertyChanged("TextSize"); |
998 |
} |
999 |
} |
1000 |
#endregion |
1001 |
|
1002 |
public ImageBrush BackgroundImage |
1003 |
{ |
1004 |
get |
1005 |
{ |
1006 |
return backgroundImage; |
1007 |
} |
1008 |
set |
1009 |
{ |
1010 |
backgroundImage = value; |
1011 |
OnPropertyChanged("BackgroundImage"); |
1012 |
} |
1013 |
} |
1014 |
|
1015 |
public ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> Document_Info |
1016 |
{ |
1017 |
get |
1018 |
{ |
1019 |
return document_Info; |
1020 |
} |
1021 |
} |
1022 |
|
1023 |
public double ContentScale |
1024 |
{ |
1025 |
get |
1026 |
{ |
1027 |
return contentScale; |
1028 |
} |
1029 |
set |
1030 |
{ |
1031 |
contentScale = value; |
1032 |
|
1033 |
double minOffsetX = 0.0; |
1034 |
double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth); |
1035 |
contentOffsetX = Math.Min(Math.Max(contentOffsetX, minOffsetX), maxOffsetX); |
1036 |
|
1037 |
double minOffsetY = 0.0; |
1038 |
double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight); |
1039 |
contentOffsetY = Math.Min(Math.Max(contentOffsetY, minOffsetY), maxOffsetY); |
1040 |
|
1041 |
OnPropertyChanged("ContentScale"); |
1042 |
} |
1043 |
} |
1044 |
|
1045 |
public double Sync_ContentScale |
1046 |
{ |
1047 |
get |
1048 |
{ |
1049 |
return Sync_contentScale; |
1050 |
} |
1051 |
set |
1052 |
{ |
1053 |
Sync_contentScale = value; |
1054 |
OnPropertyChanged("Sync_ContentScale"); |
1055 |
} |
1056 |
} |
1057 |
|
1058 |
public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoList |
1059 |
{ |
1060 |
get |
1061 |
{ |
1062 |
return markupInfoList; |
1063 |
} |
1064 |
set |
1065 |
{ |
1066 |
markupInfoList = value; |
1067 |
OnPropertyChanged("_markupInfoList"); |
1068 |
} |
1069 |
} |
1070 |
|
1071 |
public ObservableCollection<MarkupUserInfo> _markupUserList |
1072 |
{ |
1073 |
get |
1074 |
{ |
1075 |
return markupUserList; |
1076 |
} |
1077 |
set |
1078 |
{ |
1079 |
markupUserList = value; |
1080 |
OnPropertyChanged("_markupUserList"); |
1081 |
} |
1082 |
} |
1083 |
|
1084 |
public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoRevList |
1085 |
{ |
1086 |
get |
1087 |
{ |
1088 |
return markupInfoRevList; |
1089 |
} |
1090 |
set |
1091 |
{ |
1092 |
markupInfoRevList = value; |
1093 |
OnPropertyChanged("_markupInfoRevList"); |
1094 |
} |
1095 |
} |
1096 |
|
1097 |
public double ContentOffsetX |
1098 |
{ |
1099 |
get |
1100 |
{ |
1101 |
return contentOffsetX; |
1102 |
} |
1103 |
set |
1104 |
{ |
1105 |
double minOffsetX = 0.0; |
1106 |
double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth); |
1107 |
contentOffsetX = Math.Min(Math.Max(value, minOffsetX), maxOffsetX); |
1108 |
OnPropertyChanged("ContentOffsetX"); |
1109 |
} |
1110 |
} |
1111 |
|
1112 |
public double ContentOffsetY |
1113 |
{ |
1114 |
get |
1115 |
{ |
1116 |
return contentOffsetY; |
1117 |
} |
1118 |
set |
1119 |
{ |
1120 |
double minOffsetY = 0.0; |
1121 |
double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight); |
1122 |
contentOffsetY = Math.Min(Math.Max(value, minOffsetY), maxOffsetY); |
1123 |
OnPropertyChanged("ContentOffsetY"); |
1124 |
} |
1125 |
} |
1126 |
|
1127 |
public double Sync_ContentOffsetX |
1128 |
{ |
1129 |
get |
1130 |
{ |
1131 |
return Sync_contentOffsetX; |
1132 |
} |
1133 |
set |
1134 |
{ |
1135 |
Sync_contentOffsetX = value; |
1136 |
OnPropertyChanged("Sync_ContentOffsetX"); |
1137 |
} |
1138 |
} |
1139 |
|
1140 |
public double Sync_ContentOffsetY |
1141 |
{ |
1142 |
get |
1143 |
{ |
1144 |
return Sync_contentOffsetY; |
1145 |
} |
1146 |
set |
1147 |
{ |
1148 |
Sync_contentOffsetY = value; |
1149 |
OnPropertyChanged("Sync_ContentOffsetY"); |
1150 |
} |
1151 |
} |
1152 |
|
1153 |
public MessageCollection k_talkMessageSet |
1154 |
{ |
1155 |
get |
1156 |
{ |
1157 |
if (_k_talkMessageSet == null) |
1158 |
{ |
1159 |
_k_talkMessageSet = new MessageCollection(); |
1160 |
} |
1161 |
return _k_talkMessageSet; |
1162 |
} |
1163 |
set |
1164 |
{ |
1165 |
_k_talkMessageSet = value; |
1166 |
OnPropertyChanged("k_talkMessageSet"); |
1167 |
} |
1168 |
} |
1169 |
|
1170 |
public double ContentWidth |
1171 |
{ |
1172 |
get |
1173 |
{ |
1174 |
return contentWidth; |
1175 |
} |
1176 |
set |
1177 |
{ |
1178 |
contentWidth = value; |
1179 |
OnPropertyChanged("ContentWidth"); |
1180 |
} |
1181 |
} |
1182 |
|
1183 |
public double ContentHeight |
1184 |
{ |
1185 |
get |
1186 |
{ |
1187 |
return contentHeight; |
1188 |
} |
1189 |
set |
1190 |
{ |
1191 |
contentHeight = value; |
1192 |
OnPropertyChanged("ContentHeight"); |
1193 |
} |
1194 |
} |
1195 |
|
1196 |
public double ContentViewportWidth |
1197 |
{ |
1198 |
get |
1199 |
{ |
1200 |
return contentViewportWidth; |
1201 |
} |
1202 |
set |
1203 |
{ |
1204 |
contentViewportWidth = value; |
1205 |
OnPropertyChanged("ContentViewportWidth"); |
1206 |
} |
1207 |
} |
1208 |
|
1209 |
public double ContentViewportHeight |
1210 |
{ |
1211 |
get |
1212 |
{ |
1213 |
return contentViewportHeight; |
1214 |
} |
1215 |
set |
1216 |
{ |
1217 |
contentViewportHeight = value; |
1218 |
OnPropertyChanged("ContentViewportHeight"); |
1219 |
} |
1220 |
} |
1221 |
|
1222 |
public MainWindow SystemMain { get; set; } |
1223 |
|
1224 |
private bool _PageBalanceMode { get; set; } |
1225 |
public bool PageBalanceMode |
1226 |
{ |
1227 |
get |
1228 |
{ |
1229 |
return _PageBalanceMode; |
1230 |
} |
1231 |
set |
1232 |
{ |
1233 |
_PageBalanceMode = value; |
1234 |
OnPropertyChanged("PageBalanceMode"); |
1235 |
} |
1236 |
} |
1237 |
|
1238 |
private int _PageBalanceNumber { get; set; } |
1239 |
public int PageBalanceNumber |
1240 |
{ |
1241 |
get |
1242 |
{ |
1243 |
return _PageBalanceNumber; |
1244 |
} |
1245 |
set |
1246 |
{ |
1247 |
_PageBalanceNumber = value; |
1248 |
OnPropertyChanged("PageBalanceNumber"); |
1249 |
} |
1250 |
} |
1251 |
|
1252 |
|
1253 |
private int _SyncPageNumber { get; set; } |
1254 |
|
1255 |
/// <summary> |
1256 |
/// Sync Page No |
1257 |
/// </summary> |
1258 |
public int SyncPageNumber |
1259 |
{ |
1260 |
get |
1261 |
{ |
1262 |
return _SyncPageNumber; |
1263 |
} |
1264 |
set |
1265 |
{ |
1266 |
if (_SyncPageNumber != value) |
1267 |
{ |
1268 |
_SyncPageNumber = value; |
1269 |
OnPropertyChanged("PageNumber"); |
1270 |
} |
1271 |
} |
1272 |
} |
1273 |
|
1274 |
public double AngleOffsetX |
1275 |
{ |
1276 |
get |
1277 |
{ |
1278 |
return angleOffsetX; |
1279 |
} |
1280 |
set |
1281 |
{ |
1282 |
angleOffsetX = value; |
1283 |
OnPropertyChanged("AngleOffsetX"); |
1284 |
} |
1285 |
} |
1286 |
|
1287 |
public double AngleOffsetY |
1288 |
{ |
1289 |
get |
1290 |
{ |
1291 |
return angleOffsetY; |
1292 |
} |
1293 |
set |
1294 |
{ |
1295 |
angleOffsetY = value; |
1296 |
OnPropertyChanged("AngleOffsetY"); |
1297 |
} |
1298 |
} |
1299 |
|
1300 |
//강인구 추가(체크리스트) |
1301 |
private string _CheckList_ID { get; set; } |
1302 |
public string CheckList_ID |
1303 |
{ |
1304 |
get |
1305 |
{ |
1306 |
return _CheckList_ID; |
1307 |
} |
1308 |
set |
1309 |
{ |
1310 |
_CheckList_ID = value; |
1311 |
OnPropertyChanged("CheckList_ID"); |
1312 |
} |
1313 |
} |
1314 |
//강인구 추가(캡쳐 모드) |
1315 |
private double _Capture_Opacity { get; set; } |
1316 |
public double Capture_Opacity |
1317 |
{ |
1318 |
get |
1319 |
{ |
1320 |
return _Capture_Opacity; |
1321 |
} |
1322 |
set |
1323 |
{ |
1324 |
_Capture_Opacity = value; |
1325 |
OnPropertyChanged("Capture_Opacity"); |
1326 |
} |
1327 |
} |
1328 |
|
1329 |
private Visibility _ViewVisible { get; set; } |
1330 |
public Visibility ViewVisible |
1331 |
{ |
1332 |
get |
1333 |
{ |
1334 |
return _ViewVisible; |
1335 |
} |
1336 |
set |
1337 |
{ |
1338 |
_ViewVisible = value; |
1339 |
OnPropertyChanged("ViewVisible"); |
1340 |
} |
1341 |
} |
1342 |
|
1343 |
private bool _IsSync { get; set; } |
1344 |
public bool IsSync |
1345 |
{ |
1346 |
get |
1347 |
{ |
1348 |
return _IsSync; |
1349 |
} |
1350 |
set |
1351 |
{ |
1352 |
_IsSync = value; |
1353 |
OnPropertyChanged("IsSync"); |
1354 |
} |
1355 |
} |
1356 |
|
1357 |
private System.Windows.Media.Imaging.BitmapFrame _ImageViewPath; |
1358 |
public System.Windows.Media.Imaging.BitmapFrame ImageViewPath |
1359 |
{ |
1360 |
get |
1361 |
{ |
1362 |
return _ImageViewPath; |
1363 |
} |
1364 |
set |
1365 |
{ |
1366 |
_ImageViewPath = value; |
1367 |
OnPropertyChanged("ImageViewPath"); |
1368 |
} |
1369 |
} |
1370 |
private double _ImageViewWidth { get; set; } |
1371 |
public double ImageViewWidth |
1372 |
{ |
1373 |
get |
1374 |
{ |
1375 |
return _ImageViewWidth; |
1376 |
} |
1377 |
set |
1378 |
{ |
1379 |
_ImageViewWidth = value; |
1380 |
OnPropertyChanged("ImageViewWidth"); |
1381 |
} |
1382 |
} |
1383 |
private double _ImageViewHeight { get; set; } |
1384 |
public double ImageViewHeight |
1385 |
{ |
1386 |
get |
1387 |
{ |
1388 |
return _ImageViewHeight; |
1389 |
} |
1390 |
set |
1391 |
{ |
1392 |
_ImageViewHeight = value; |
1393 |
OnPropertyChanged("ImageViewHeight"); |
1394 |
} |
1395 |
} |
1396 |
|
1397 |
private System.Windows.Media.Imaging.BitmapImage _ImageViewPath_C; |
1398 |
public System.Windows.Media.Imaging.BitmapImage ImageViewPath_C |
1399 |
{ |
1400 |
get |
1401 |
{ |
1402 |
return _ImageViewPath_C; |
1403 |
} |
1404 |
set |
1405 |
{ |
1406 |
_ImageViewPath_C = value; |
1407 |
OnPropertyChanged("ImageViewPath_C"); |
1408 |
} |
1409 |
} |
1410 |
private double _ImageViewWidth_C { get; set; } |
1411 |
public double ImageViewWidth_C |
1412 |
{ |
1413 |
get |
1414 |
{ |
1415 |
return _ImageViewWidth_C; |
1416 |
} |
1417 |
set |
1418 |
{ |
1419 |
_ImageViewWidth_C = value; |
1420 |
OnPropertyChanged("ImageViewWidth_C"); |
1421 |
} |
1422 |
} |
1423 |
private double _ImageViewHeight_C { get; set; } |
1424 |
public double ImageViewHeight_C |
1425 |
{ |
1426 |
get |
1427 |
{ |
1428 |
return _ImageViewHeight_C; |
1429 |
} |
1430 |
set |
1431 |
{ |
1432 |
_ImageViewHeight_C = value; |
1433 |
OnPropertyChanged("ImageViewHeight_C"); |
1434 |
} |
1435 |
} |
1436 |
|
1437 |
|
1438 |
#endregion Property Member |
1439 |
|
1440 |
public System.IO.Stream GetStreamFromUrl(string url) |
1441 |
{ |
1442 |
byte[] imageData = null; |
1443 |
|
1444 |
using (var wc = new System.Net.WebClient()) |
1445 |
imageData = wc.DownloadData(url); |
1446 |
|
1447 |
return new System.IO.MemoryStream(imageData); |
1448 |
} |
1449 |
|
1450 |
public ViewerDataModel() |
1451 |
{ |
1452 |
//rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue)); |
1453 |
//rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green)); |
1454 |
//rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple)); |
1455 |
//rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red)); |
1456 |
|
1457 |
//RectangleControl rect1 = new RectangleControl(); |
1458 |
//rect1.StartPoint = new Point(50, 50); |
1459 |
//rect1.LeftBottomPoint = new Point(100, 50); |
1460 |
//rect1.TopRightPoint = new Point(50, 100); |
1461 |
//rect1.EndPoint = new Point(100, 100); |
1462 |
//rect1.FillColor = new SolidColorBrush(Colors.Red); |
1463 |
//rectangles.Add(rect1); |
1464 |
// |
1465 |
// Populate the data model with some example data. |
1466 |
// |
1467 |
//rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue)); |
1468 |
//rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green)); |
1469 |
//rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple)); |
1470 |
//rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red)); |
1471 |
|
1472 |
this.ControlOpacity = 1; |
1473 |
|
1474 |
/* Default |
1475 |
LineSize = 3, TextSize = 30, Interval = 10, ArcLength = 10, SaveInterval = 5 |
1476 |
*/ |
1477 |
this.LineSize = KCOM.Properties.Settings.Default.LineSize; |
1478 |
|
1479 |
this.TextSize = KCOM.Properties.Settings.Default.TextSize; |
1480 |
|
1481 |
this.Interval = KCOM.Properties.Settings.Default.Interval; |
1482 |
|
1483 |
this.ArcLength = KCOM.Properties.Settings.Default.ArcLength; |
1484 |
|
1485 |
this.DashSize = new DoubleCollection(); |
1486 |
|
1487 |
this.SaveInterval = KCOM.Properties.Settings.Default.SaveInterval; |
1488 |
this.MarkupAngleVisibility = Visibility.Collapsed; |
1489 |
} |
1490 |
|
1491 |
|
1492 |
public List<IKCOM.MarkupInfoItem> SelectedmarkupInfoItems { get; set; } |
1493 |
public bool IsMarkupUpdate { get => isMarkupUpdate; set => isMarkupUpdate = value; } |
1494 |
|
1495 |
#region INotifyPropertyChanged Event |
1496 |
|
1497 |
private void OnPropertyChanged(string name) |
1498 |
{ |
1499 |
if (PropertyChanged != null) |
1500 |
{ |
1501 |
PropertyChanged(this, new PropertyChangedEventArgs(name)); |
1502 |
} |
1503 |
} |
1504 |
|
1505 |
public event PropertyChangedEventHandler PropertyChanged; |
1506 |
|
1507 |
#endregion |
1508 |
} |
1509 |
} |