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