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