markus / KCOM / Common / ViewerDataModel.cs @ 4f017ed3
이력 | 보기 | 이력해설 | 다운로드 (33.3 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() |
578 |
{ |
579 |
if(PageLoaded != null) |
580 |
{ |
581 |
PageLoaded(this, new EventArgs()); |
582 |
} |
583 |
} |
584 |
|
585 |
public void SetAngleVisible(Visibility visibility) |
586 |
{ |
587 |
this.MarkupAngleVisibility = visibility; |
588 |
} |
589 |
|
590 |
|
591 |
public ObservableCollection<CommentUserInfo> MarkupControls |
592 |
{ |
593 |
get |
594 |
{ |
595 |
return markupControls; |
596 |
} |
597 |
} |
598 |
|
599 |
public ObservableCollection<CommentUserInfo> MarkupControls_Sync |
600 |
{ |
601 |
get |
602 |
{ |
603 |
return markupControls_Sync; |
604 |
} |
605 |
} |
606 |
public int current_page_commentcnt = 0; |
607 |
public ObservableCollection<CommentUserInfo> MarkupControls_USER |
608 |
{ |
609 |
get |
610 |
{ |
611 |
return markupControls_User; |
612 |
} |
613 |
} |
614 |
|
615 |
public ObservableCollection<Undo_data> UndoDataList |
616 |
{ |
617 |
get |
618 |
{ |
619 |
return undoDataList; |
620 |
} |
621 |
} |
622 |
|
623 |
public StrokeCollection MarkupPens |
624 |
{ |
625 |
get |
626 |
{ |
627 |
return markupPens; |
628 |
} |
629 |
|
630 |
} |
631 |
|
632 |
#region 버튼 여부 |
633 |
|
634 |
/// <summary> |
635 |
/// 상단 Fill 버튼이 클릭 되어있는지 |
636 |
/// </summary> |
637 |
private bool _checkFillShape { get; set; } |
638 |
public bool checkFillShape |
639 |
{ |
640 |
get |
641 |
{ |
642 |
return _checkFillShape; |
643 |
} |
644 |
set |
645 |
{ |
646 |
_checkFillShape = value; |
647 |
OnPropertyChanged("checkFillShape"); |
648 |
} |
649 |
} |
650 |
|
651 |
/// <summary> |
652 |
/// 상단 Hatch 버튼이 클릭 되어있는지 |
653 |
/// </summary> |
654 |
private bool _checkHatchShape { get; set; } |
655 |
public bool checkHatchShape |
656 |
{ |
657 |
get |
658 |
{ |
659 |
return _checkHatchShape; |
660 |
} |
661 |
set |
662 |
{ |
663 |
_checkHatchShape = value; |
664 |
OnPropertyChanged("checkHatchShape"); |
665 |
} |
666 |
} |
667 |
|
668 |
private double _controlOpacity { get; set; } |
669 |
public double ControlOpacity |
670 |
{ |
671 |
get |
672 |
{ |
673 |
return _controlOpacity; |
674 |
} |
675 |
set |
676 |
{ |
677 |
|
678 |
_controlOpacity = value; |
679 |
OnPropertyChanged("ControlOpacity"); |
680 |
} |
681 |
} |
682 |
|
683 |
private MarkupToPDF.Controls.Common.PaintSet _paintSet { get; set; } |
684 |
public MarkupToPDF.Controls.Common.PaintSet paintSet |
685 |
{ |
686 |
get |
687 |
{ |
688 |
return _paintSet; |
689 |
} |
690 |
set |
691 |
{ |
692 |
_paintSet = value; |
693 |
OnPropertyChanged("paintSet"); |
694 |
} |
695 |
} |
696 |
|
697 |
/// <summary> |
698 |
/// 강인구 추가 |
699 |
/// 상단 TextStyle 버튼이 클릭 되어있는지 |
700 |
/// </summary> |
701 |
private bool _checkTextStyle { get; set; } |
702 |
public bool checkTextStyle |
703 |
{ |
704 |
get |
705 |
{ |
706 |
return _checkTextStyle; |
707 |
} |
708 |
set |
709 |
{ |
710 |
_checkTextStyle = value; |
711 |
OnPropertyChanged("checkTextStyle"); |
712 |
} |
713 |
} |
714 |
|
715 |
/// <summary> |
716 |
/// 강인구 추가 |
717 |
/// 상단 TextWeight 버튼이 클릭 되어있는지 |
718 |
/// </summary> |
719 |
private bool _checkTextWeight { get; set; } |
720 |
public bool checkTextWeight |
721 |
{ |
722 |
get |
723 |
{ |
724 |
return _checkTextWeight; |
725 |
} |
726 |
set |
727 |
{ |
728 |
_checkTextWeight = value; |
729 |
OnPropertyChanged("checkTextWeight"); |
730 |
} |
731 |
} |
732 |
|
733 |
/// <summary> |
734 |
/// 강인구 추가 |
735 |
/// 상단 UnderLine 버튼이 클릭 되어있는지 |
736 |
/// </summary> |
737 |
private bool _checkUnderLine { get; set; } |
738 |
public bool checkUnderLine |
739 |
{ |
740 |
get |
741 |
{ |
742 |
return _checkUnderLine; |
743 |
} |
744 |
set |
745 |
{ |
746 |
_checkUnderLine = value; |
747 |
OnPropertyChanged("checkUnderLine"); |
748 |
} |
749 |
} |
750 |
|
751 |
/// <summary> |
752 |
/// 상단 Hatch 버튼이 클릭 되어있는지 |
753 |
/// </summary> |
754 |
private bool _checkHighShape { get; set; } |
755 |
public bool checkHighShape |
756 |
{ |
757 |
get |
758 |
{ |
759 |
return _checkHighShape; |
760 |
} |
761 |
set |
762 |
{ |
763 |
_checkHighShape = value; |
764 |
OnPropertyChanged("checkHighShape"); |
765 |
} |
766 |
} |
767 |
|
768 |
/// <summary> |
769 |
/// 상단 Axis 버튼이 클릭 되어있는지 |
770 |
/// </summary> |
771 |
private bool _IsAxisLock { get; set; } |
772 |
public bool IsAxisLock |
773 |
{ |
774 |
get |
775 |
{ |
776 |
return _IsAxisLock; |
777 |
} |
778 |
set |
779 |
{ |
780 |
_IsAxisLock = value; |
781 |
OnPropertyChanged("IsAxisLock"); |
782 |
} |
783 |
} |
784 |
|
785 |
/// <summary> |
786 |
/// 상단 Highlight 버튼이 클릭 되어있는지 |
787 |
/// </summary> |
788 |
private bool _checkHighlight { get; set; } |
789 |
public bool checkHighlight |
790 |
{ |
791 |
get |
792 |
{ |
793 |
return _checkHighlight; |
794 |
} |
795 |
set |
796 |
{ |
797 |
_checkHighlight = value; |
798 |
OnPropertyChanged("checkHighlight"); |
799 |
} |
800 |
} |
801 |
|
802 |
/// <summary> |
803 |
/// 강인구 추가 |
804 |
/// 상단 TextWeight 버튼이 클릭 되어있는지 |
805 |
/// </summary> |
806 |
private double _TextSize { get; set; } |
807 |
public double TextSize |
808 |
{ |
809 |
get |
810 |
{ |
811 |
return _TextSize; |
812 |
} |
813 |
set |
814 |
{ |
815 |
_TextSize = value; |
816 |
OnPropertyChanged("TextSize"); |
817 |
} |
818 |
} |
819 |
#endregion |
820 |
|
821 |
public ImageBrush BackgroundImage |
822 |
{ |
823 |
get |
824 |
{ |
825 |
return backgroundImage; |
826 |
} |
827 |
set |
828 |
{ |
829 |
backgroundImage = value; |
830 |
OnPropertyChanged("BackgroundImage"); |
831 |
} |
832 |
} |
833 |
|
834 |
public ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> Document_Info |
835 |
{ |
836 |
get |
837 |
{ |
838 |
return document_Info; |
839 |
} |
840 |
} |
841 |
|
842 |
public double ContentScale |
843 |
{ |
844 |
get |
845 |
{ |
846 |
return contentScale; |
847 |
} |
848 |
set |
849 |
{ |
850 |
contentScale = value; |
851 |
|
852 |
double minOffsetX = 0.0; |
853 |
double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth); |
854 |
contentOffsetX = Math.Min(Math.Max(contentOffsetX, minOffsetX), maxOffsetX); |
855 |
|
856 |
double minOffsetY = 0.0; |
857 |
double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight); |
858 |
contentOffsetY = Math.Min(Math.Max(contentOffsetY, minOffsetY), maxOffsetY); |
859 |
|
860 |
OnPropertyChanged("ContentScale"); |
861 |
} |
862 |
} |
863 |
|
864 |
public double Sync_ContentScale |
865 |
{ |
866 |
get |
867 |
{ |
868 |
return Sync_contentScale; |
869 |
} |
870 |
set |
871 |
{ |
872 |
Sync_contentScale = value; |
873 |
OnPropertyChanged("Sync_ContentScale"); |
874 |
} |
875 |
} |
876 |
|
877 |
public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoList |
878 |
{ |
879 |
get |
880 |
{ |
881 |
return markupInfoList; |
882 |
} |
883 |
set |
884 |
{ |
885 |
markupInfoList = value; |
886 |
OnPropertyChanged("_markupInfoList"); |
887 |
} |
888 |
} |
889 |
|
890 |
public ObservableCollection<MarkupUserInfo> _markupUserList |
891 |
{ |
892 |
get |
893 |
{ |
894 |
return markupUserList; |
895 |
} |
896 |
set |
897 |
{ |
898 |
markupUserList = value; |
899 |
OnPropertyChanged("_markupUserList"); |
900 |
} |
901 |
} |
902 |
|
903 |
public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoRevList |
904 |
{ |
905 |
get |
906 |
{ |
907 |
return markupInfoRevList; |
908 |
} |
909 |
set |
910 |
{ |
911 |
markupInfoRevList = value; |
912 |
OnPropertyChanged("_markupInfoRevList"); |
913 |
} |
914 |
} |
915 |
|
916 |
public double ContentOffsetX |
917 |
{ |
918 |
get |
919 |
{ |
920 |
return contentOffsetX; |
921 |
} |
922 |
set |
923 |
{ |
924 |
double minOffsetX = 0.0; |
925 |
double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth); |
926 |
contentOffsetX = Math.Min(Math.Max(value, minOffsetX), maxOffsetX); |
927 |
OnPropertyChanged("ContentOffsetX"); |
928 |
} |
929 |
} |
930 |
|
931 |
public double ContentOffsetY |
932 |
{ |
933 |
get |
934 |
{ |
935 |
return contentOffsetY; |
936 |
} |
937 |
set |
938 |
{ |
939 |
double minOffsetY = 0.0; |
940 |
double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight); |
941 |
contentOffsetY = Math.Min(Math.Max(value, minOffsetY), maxOffsetY); |
942 |
OnPropertyChanged("ContentOffsetY"); |
943 |
} |
944 |
} |
945 |
|
946 |
public double Sync_ContentOffsetX |
947 |
{ |
948 |
get |
949 |
{ |
950 |
return Sync_contentOffsetX; |
951 |
} |
952 |
set |
953 |
{ |
954 |
Sync_contentOffsetX = value; |
955 |
OnPropertyChanged("Sync_ContentOffsetX"); |
956 |
} |
957 |
} |
958 |
|
959 |
public double Sync_ContentOffsetY |
960 |
{ |
961 |
get |
962 |
{ |
963 |
return Sync_contentOffsetY; |
964 |
} |
965 |
set |
966 |
{ |
967 |
Sync_contentOffsetY = value; |
968 |
OnPropertyChanged("Sync_ContentOffsetY"); |
969 |
} |
970 |
} |
971 |
|
972 |
public MessageCollection k_talkMessageSet |
973 |
{ |
974 |
get |
975 |
{ |
976 |
if (_k_talkMessageSet == null) |
977 |
{ |
978 |
_k_talkMessageSet = new MessageCollection(); |
979 |
} |
980 |
return _k_talkMessageSet; |
981 |
} |
982 |
set |
983 |
{ |
984 |
_k_talkMessageSet = value; |
985 |
OnPropertyChanged("k_talkMessageSet"); |
986 |
} |
987 |
} |
988 |
|
989 |
public double ContentWidth |
990 |
{ |
991 |
get |
992 |
{ |
993 |
return contentWidth; |
994 |
} |
995 |
set |
996 |
{ |
997 |
contentWidth = value; |
998 |
OnPropertyChanged("ContentWidth"); |
999 |
} |
1000 |
} |
1001 |
|
1002 |
public double ContentHeight |
1003 |
{ |
1004 |
get |
1005 |
{ |
1006 |
return contentHeight; |
1007 |
} |
1008 |
set |
1009 |
{ |
1010 |
contentHeight = value; |
1011 |
OnPropertyChanged("ContentHeight"); |
1012 |
} |
1013 |
} |
1014 |
|
1015 |
public double ContentViewportWidth |
1016 |
{ |
1017 |
get |
1018 |
{ |
1019 |
return contentViewportWidth; |
1020 |
} |
1021 |
set |
1022 |
{ |
1023 |
contentViewportWidth = value; |
1024 |
OnPropertyChanged("ContentViewportWidth"); |
1025 |
} |
1026 |
} |
1027 |
|
1028 |
public double ContentViewportHeight |
1029 |
{ |
1030 |
get |
1031 |
{ |
1032 |
return contentViewportHeight; |
1033 |
} |
1034 |
set |
1035 |
{ |
1036 |
contentViewportHeight = value; |
1037 |
OnPropertyChanged("ContentViewportHeight"); |
1038 |
} |
1039 |
} |
1040 |
|
1041 |
public MainWindow SystemMain { get; set; } |
1042 |
|
1043 |
private bool _PageBalanceMode { get; set; } |
1044 |
public bool PageBalanceMode |
1045 |
{ |
1046 |
get |
1047 |
{ |
1048 |
return _PageBalanceMode; |
1049 |
} |
1050 |
set |
1051 |
{ |
1052 |
_PageBalanceMode = value; |
1053 |
OnPropertyChanged("PageBalanceMode"); |
1054 |
} |
1055 |
} |
1056 |
|
1057 |
private int _PageBalanceNumber { get; set; } |
1058 |
public int PageBalanceNumber |
1059 |
{ |
1060 |
get |
1061 |
{ |
1062 |
return _PageBalanceNumber; |
1063 |
} |
1064 |
set |
1065 |
{ |
1066 |
_PageBalanceNumber = value; |
1067 |
OnPropertyChanged("PageBalanceNumber"); |
1068 |
} |
1069 |
} |
1070 |
|
1071 |
private int _PageNumber { get; set; } |
1072 |
public int PageNumber |
1073 |
{ |
1074 |
get |
1075 |
{ |
1076 |
return _PageNumber; |
1077 |
} |
1078 |
set |
1079 |
{ |
1080 |
if (_PageNumber != value) |
1081 |
{ |
1082 |
_PageNumber = value; |
1083 |
OnPropertyChanged("PageNumber"); |
1084 |
} |
1085 |
} |
1086 |
} |
1087 |
|
1088 |
public double AngleOffsetX |
1089 |
{ |
1090 |
get |
1091 |
{ |
1092 |
return angleOffsetX; |
1093 |
} |
1094 |
set |
1095 |
{ |
1096 |
angleOffsetX = value; |
1097 |
OnPropertyChanged("AngleOffsetX"); |
1098 |
} |
1099 |
} |
1100 |
|
1101 |
public double AngleOffsetY |
1102 |
{ |
1103 |
get |
1104 |
{ |
1105 |
return angleOffsetY; |
1106 |
} |
1107 |
set |
1108 |
{ |
1109 |
angleOffsetY = value; |
1110 |
OnPropertyChanged("AngleOffsetY"); |
1111 |
} |
1112 |
} |
1113 |
|
1114 |
//강인구 추가(체크리스트) |
1115 |
private string _CheckList_ID { get; set; } |
1116 |
public string CheckList_ID |
1117 |
{ |
1118 |
get |
1119 |
{ |
1120 |
return _CheckList_ID; |
1121 |
} |
1122 |
set |
1123 |
{ |
1124 |
_CheckList_ID = value; |
1125 |
OnPropertyChanged("CheckList_ID"); |
1126 |
} |
1127 |
} |
1128 |
//강인구 추가(캡쳐 모드) |
1129 |
private double _Capture_Opacity { get; set; } |
1130 |
public double Capture_Opacity |
1131 |
{ |
1132 |
get |
1133 |
{ |
1134 |
return _Capture_Opacity; |
1135 |
} |
1136 |
set |
1137 |
{ |
1138 |
_Capture_Opacity = value; |
1139 |
OnPropertyChanged("Capture_Opacity"); |
1140 |
} |
1141 |
} |
1142 |
|
1143 |
private Visibility _ViewVisible { get; set; } |
1144 |
public Visibility ViewVisible |
1145 |
{ |
1146 |
get |
1147 |
{ |
1148 |
return _ViewVisible; |
1149 |
} |
1150 |
set |
1151 |
{ |
1152 |
_ViewVisible = value; |
1153 |
OnPropertyChanged("ViewVisible"); |
1154 |
} |
1155 |
} |
1156 |
|
1157 |
private bool _IsSync { get; set; } |
1158 |
public bool IsSync |
1159 |
{ |
1160 |
get |
1161 |
{ |
1162 |
return _IsSync; |
1163 |
} |
1164 |
set |
1165 |
{ |
1166 |
_IsSync = value; |
1167 |
OnPropertyChanged("IsSync"); |
1168 |
} |
1169 |
} |
1170 |
|
1171 |
private System.Windows.Media.Imaging.BitmapFrame _ImageViewPath; |
1172 |
public System.Windows.Media.Imaging.BitmapFrame ImageViewPath |
1173 |
{ |
1174 |
get |
1175 |
{ |
1176 |
return _ImageViewPath; |
1177 |
} |
1178 |
set |
1179 |
{ |
1180 |
_ImageViewPath = value; |
1181 |
OnPropertyChanged("ImageViewPath"); |
1182 |
} |
1183 |
} |
1184 |
private double _ImageViewWidth { get; set; } |
1185 |
public double ImageViewWidth |
1186 |
{ |
1187 |
get |
1188 |
{ |
1189 |
return _ImageViewWidth; |
1190 |
} |
1191 |
set |
1192 |
{ |
1193 |
_ImageViewWidth = value; |
1194 |
OnPropertyChanged("ImageViewWidth"); |
1195 |
} |
1196 |
} |
1197 |
private double _ImageViewHeight { get; set; } |
1198 |
public double ImageViewHeight |
1199 |
{ |
1200 |
get |
1201 |
{ |
1202 |
return _ImageViewHeight; |
1203 |
} |
1204 |
set |
1205 |
{ |
1206 |
_ImageViewHeight = value; |
1207 |
OnPropertyChanged("ImageViewHeight"); |
1208 |
} |
1209 |
} |
1210 |
|
1211 |
private System.Windows.Media.Imaging.BitmapImage _ImageViewPath_C; |
1212 |
public System.Windows.Media.Imaging.BitmapImage ImageViewPath_C |
1213 |
{ |
1214 |
get |
1215 |
{ |
1216 |
return _ImageViewPath_C; |
1217 |
} |
1218 |
set |
1219 |
{ |
1220 |
_ImageViewPath_C = value; |
1221 |
OnPropertyChanged("ImageViewPath_C"); |
1222 |
} |
1223 |
} |
1224 |
private double _ImageViewWidth_C { get; set; } |
1225 |
public double ImageViewWidth_C |
1226 |
{ |
1227 |
get |
1228 |
{ |
1229 |
return _ImageViewWidth_C; |
1230 |
} |
1231 |
set |
1232 |
{ |
1233 |
_ImageViewWidth_C = value; |
1234 |
OnPropertyChanged("ImageViewWidth_C"); |
1235 |
} |
1236 |
} |
1237 |
private double _ImageViewHeight_C { get; set; } |
1238 |
public double ImageViewHeight_C |
1239 |
{ |
1240 |
get |
1241 |
{ |
1242 |
return _ImageViewHeight_C; |
1243 |
} |
1244 |
set |
1245 |
{ |
1246 |
_ImageViewHeight_C = value; |
1247 |
OnPropertyChanged("ImageViewHeight_C"); |
1248 |
} |
1249 |
} |
1250 |
|
1251 |
|
1252 |
#endregion Property Member |
1253 |
|
1254 |
public System.IO.Stream GetStreamFromUrl(string url) |
1255 |
{ |
1256 |
byte[] imageData = null; |
1257 |
|
1258 |
using (var wc = new System.Net.WebClient()) |
1259 |
imageData = wc.DownloadData(url); |
1260 |
|
1261 |
return new System.IO.MemoryStream(imageData); |
1262 |
} |
1263 |
|
1264 |
public ViewerDataModel() |
1265 |
{ |
1266 |
//rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue)); |
1267 |
//rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green)); |
1268 |
//rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple)); |
1269 |
//rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red)); |
1270 |
|
1271 |
//RectangleControl rect1 = new RectangleControl(); |
1272 |
//rect1.StartPoint = new Point(50, 50); |
1273 |
//rect1.LeftBottomPoint = new Point(100, 50); |
1274 |
//rect1.TopRightPoint = new Point(50, 100); |
1275 |
//rect1.EndPoint = new Point(100, 100); |
1276 |
//rect1.FillColor = new SolidColorBrush(Colors.Red); |
1277 |
//rectangles.Add(rect1); |
1278 |
// |
1279 |
// Populate the data model with some example data. |
1280 |
// |
1281 |
//rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue)); |
1282 |
//rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green)); |
1283 |
//rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple)); |
1284 |
//rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red)); |
1285 |
|
1286 |
this.ControlOpacity = 1; |
1287 |
|
1288 |
/* Default |
1289 |
LineSize = 3, TextSize = 30, Interval = 10, ArcLength = 10, SaveInterval = 5 |
1290 |
*/ |
1291 |
this.LineSize = KCOM.Properties.Settings.Default.LineSize; |
1292 |
|
1293 |
this.TextSize = KCOM.Properties.Settings.Default.TextSize; |
1294 |
|
1295 |
this.Interval = KCOM.Properties.Settings.Default.Interval; |
1296 |
|
1297 |
this.ArcLength = KCOM.Properties.Settings.Default.ArcLength; |
1298 |
|
1299 |
this.DashSize = new DoubleCollection(); |
1300 |
|
1301 |
this.SaveInterval = KCOM.Properties.Settings.Default.SaveInterval; |
1302 |
this.MarkupAngleVisibility = Visibility.Collapsed; |
1303 |
} |
1304 |
|
1305 |
|
1306 |
public List<IKCOM.MarkupInfoItem> SelectedmarkupInfoItems { get; set; } |
1307 |
|
1308 |
#region INotifyPropertyChanged Event |
1309 |
|
1310 |
private void OnPropertyChanged(string name) |
1311 |
{ |
1312 |
if (PropertyChanged != null) |
1313 |
{ |
1314 |
PropertyChanged(this, new PropertyChangedEventArgs(name)); |
1315 |
} |
1316 |
} |
1317 |
|
1318 |
public event PropertyChangedEventHandler PropertyChanged; |
1319 |
|
1320 |
#endregion |
1321 |
} |
1322 |
} |