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