프로젝트

일반

사용자정보

통계
| 브랜치(Branch): | 개정판:

markus / KCOM / Common / ViewerDataModel.cs @ 8e6884a5

이력 | 보기 | 이력해설 | 다운로드 (31.7 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
        #region Data Members
29

    
30
        private static ViewerDataModel instance = new ViewerDataModel();
31

    
32
        //private ObservableCollection<CommentUserInfo> markupControls_Pre = new ObservableCollection<CommentUserInfo>();
33

    
34
        private ObservableCollection<CommentUserInfo> markupControls = new ObservableCollection<CommentUserInfo>();
35
        private ObservableCollection<CommentUserInfo> markupControls_Sync = new ObservableCollection<CommentUserInfo>();
36
        private ObservableCollection<CommentUserInfo> markupControls_User = new ObservableCollection<CommentUserInfo>();
37

    
38

    
39
        ////강인구 추가
40
        //private List<Check_Inferface> check_Item = new List<Check_Inferface>();
41
        private ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> document_Info = new ObservableCollection<KCOMDataModel.DataModel.DOCPAGE>();
42
        private ObservableCollection<Undo_data> undoDataList = new ObservableCollection<Undo_data>();
43
        
44
        //public  UndoDataList { get; set; }
45

    
46

    
47
        private ObservableCollection<IKCOM.MarkupInfoItem> markupInfoList = new ObservableCollection<IKCOM.MarkupInfoItem>();
48
        private ObservableCollection<MarkupUserInfo> markupUserList = new ObservableCollection<MarkupUserInfo>();
49
        
50
        private ObservableCollection<IKCOM.MarkupInfoItem> markupInfoRevList = new ObservableCollection<IKCOM.MarkupInfoItem>();
51

    
52
        public List<FAVORITE_DOC> FavoriteSelctedSet = new List<FAVORITE_DOC>();
53
        public List<FAVORITE_DOC> FavoriteSet = new List<FAVORITE_DOC>();
54
        public List<KCOMDataModel.DataModel.DOCPAGE> RotationDocs = new List<KCOMDataModel.DataModel.DOCPAGE>();
55
        //_markupInfoList
56

    
57
        private StrokeCollection markupPens = new StrokeCollection();
58

    
59
        //private ObservableCollection<RectangleData> rectangles = new ObservableCollection<RectangleData>();
60

    
61

    
62
        private double contentScale = 1;
63

    
64
        private double contentOffsetY = 0;
65

    
66
        private double contentOffsetX = 0;
67

    
68
        private double Sync_contentScale = 1;
69

    
70
        private double Sync_contentOffsetY = 0;
71

    
72
        private double Sync_contentOffsetX = 0;
73

    
74
        private double contentViewportHeight = 0;
75

    
76
        private double contentViewportWidth = 0;
77

    
78
        private double contentWidth = 0;
79

    
80
        private MessageCollection _k_talkMessageSet;
81

    
82
        private double contentHeight = 0;
83

    
84
        private double angle = 0;
85

    
86
        private double angleOffsetX = 0;
87

    
88
        private double angleOffsetY = 0;
89

    
90
        private ImageBrush backgroundImage;
91

    
92
        //private RasterImage _rasterimage;
93

    
94

    
95
        #endregion Data Members
96

    
97
        #region Property Member
98

    
99
        public bool IsWheelPageChanage = false;
100

    
101
        public static ViewerDataModel Instance
102
        {
103
            get
104
            {
105
                return instance;
106
            }
107
        }
108

    
109
        private bool isDownloadOriginal;
110
        public bool IsDownloadOriginal
111
        {
112
            get => isDownloadOriginal;
113
            set
114
            {
115
                if (isDownloadOriginal != value)
116
                {
117
                    isDownloadOriginal = value;
118
                    OnPropertyChanged("IsDownloadOriginal");
119
                }
120
            }
121
        }
122

    
123

    
124
        private bool isDocumentHistory;
125
        public bool IsDocumentHistory
126
        {
127
            get => isDocumentHistory;
128
            set
129
            {
130
                isDocumentHistory = value;
131
                OnPropertyChanged("IsDocumentHistory");
132
            }
133
        }
134

    
135
        private bool isDownloadCancel;
136
        public bool IsDownloadCancel
137
        {
138
            get => isDownloadCancel;
139
            set
140
            {
141
                if (isDownloadCancel != value)
142
                {
143
                    isDownloadCancel = value;
144
                    OnPropertyChanged("IsDownloadCancel");
145
                }
146
            }
147
        }
148

    
149
        private int downloadFileProgress;
150
        public int DownloadFileProgress
151
        {
152
            get => downloadFileProgress;
153
            set
154
            {
155
                if (downloadFileProgress != value)
156
                {
157
                    downloadFileProgress = value;
158
                    OnPropertyChanged("DownloadFileProgress");
159
                }
160
            }
161
        }
162

    
163
        private string originalTempFile;
164
        public string OriginalTempFile
165
        {
166
            get => originalTempFile;
167
            set
168
            {
169
                if (originalTempFile != value)
170
                {
171
                    originalTempFile = value;
172
                    OnPropertyChanged("OriginalTempFile");
173
                }
174
            }
175
        }
176

    
177
        private List<IKCOM.MarkupItemEx> _MarkupList_MY { get; set; }
178
        public List<IKCOM.MarkupItemEx> MarkupList_MY
179
        {
180
            get
181
            {
182
                if (_MarkupList_MY == null)
183
                {
184
                    _MarkupList_MY = new List<IKCOM.MarkupItemEx>();
185
                }
186

    
187
                return _MarkupList_MY;
188
            }
189
            set
190
            {
191

    
192
                _MarkupList_MY = value;
193
                OnPropertyChanged("MarkupList_MY");
194
            }
195
        }
196

    
197
        private List<IKCOM.MarkupItemEx> _MarkupList_USER { get; set; }
198
        public List<IKCOM.MarkupItemEx> MyMarkupList
199
        {
200
            get
201
            {
202
                if (_MarkupList_USER == null)
203
                {
204
                    _MarkupList_USER = new List<IKCOM.MarkupItemEx>();
205
                }
206

    
207
                return _MarkupList_USER;
208
            }
209
            set
210
            {
211

    
212
                _MarkupList_USER = value;
213
                OnPropertyChanged("_MarkupList_USER");
214
            }
215
        }
216

    
217
        private List<IKCOM.MarkupItemEx> _MarkupList_Pre { get; set; }
218
        public List<IKCOM.MarkupItemEx> MarkupList_Pre
219
        {
220
            get
221
            {
222
                if (_MarkupList_Pre == null)
223
                {
224
                    _MarkupList_Pre = new List<IKCOM.MarkupItemEx>();
225
                }
226

    
227
                return _MarkupList_Pre;
228
            }
229
            set
230
            {
231

    
232
                _MarkupList_Pre = value;
233
                OnPropertyChanged("MarkupList_Pre");
234
            }
235

    
236
        }
237

    
238
        private System.IO.FileInfo _searchPDF { get; set; }
239
        public System.IO.FileInfo searchPDF
240
        {
241
            get
242
            {
243
                return _searchPDF;
244
            }
245
            set
246
            {
247
                _searchPDF = value;
248
                OnPropertyChanged("searchPDF");
249
            }
250
        }
251

    
252

    
253
        /// <summary>
254
        /// 현재 상단 메뉴에서 선택된 컨트롤
255
        /// </summary>
256
        private string _SelectedControl { get; set; }
257
        public string SelectedControl
258
        {
259
            get
260
            {
261
                return _SelectedControl;
262
            }
263
            set
264
            {
265
                _SelectedControl = value;
266
                OnPropertyChanged("SelectedControl");
267
            }
268
        }
269

    
270

    
271
        /// <summary>
272
        /// 현재 상단 메뉴의 선 굵기값
273
        /// </summary>
274
        private double _LineSize { get; set; }
275
        public double LineSize
276
        {
277
            get
278
            {
279
                return _LineSize;
280
            }
281
            set
282
            {
283
                _LineSize = value;
284
                OnPropertyChanged("LineSize");
285
            }
286
        }
287

    
288
        private double _Interval { get; set; }
289
        public double Interval
290
        {
291
            get
292
            {
293
                return _Interval;
294
            }
295
            set
296
            {
297
                _Interval = value;
298
                OnPropertyChanged("Interval");
299
            }
300
        }
301
        private double _SaveInterval { get; set; }
302
        public double SaveInterval
303
        {
304
            get
305
            {
306
                return _SaveInterval;
307
            }
308
            set
309
            {
310
                _SaveInterval = value;
311
                OnPropertyChanged("SaveInterval");
312
            }
313
        }
314
        private double _ArcLength { get; set; }
315
        public double ArcLength
316
        {
317
            get
318
            {
319
                return _ArcLength;
320
            }
321
            set
322
            {
323
                _ArcLength = value;
324
                OnPropertyChanged("ArcLength");
325
            }
326
        }
327

    
328
        public bool IsPressShift
329
        {
330
            get
331
            {
332
                return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Shift) == System.Windows.Input.ModifierKeys.Shift);
333
            }
334
        }
335

    
336
        public bool IsPressCtrl
337
        {
338
            get
339
            {
340
                return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Control) == System.Windows.Input.ModifierKeys.Control);
341
            }
342
        }
343

    
344
        /// <summary>
345
        /// Dash 사이즈 
346
        /// </summary>
347
        private DoubleCollection _DashSize { get; set; }
348
        public DoubleCollection DashSize
349
        {
350
            get
351
            {
352
                return _DashSize;
353
            }
354
            set
355
            {
356
                _DashSize = value;
357
                OnPropertyChanged("DashSize");
358
            }
359
        }
360

    
361
        private string _ControlTag { get; set; }
362
        public string ControlTag
363
        {
364
            get
365
            {
366
                return _ControlTag;
367
            }
368
            set
369
            {
370
                _ControlTag = value;
371
                OnPropertyChanged("ControlTag");
372
            }
373
        }
374

    
375
        private string _CheckStatus { get; set; }
376
        public string CheckStatus
377
        {
378
            get
379
            {
380
                return _CheckStatus;
381
            }
382
            set
383
            {
384
                _CheckStatus = value;
385
                OnPropertyChanged("CheckStatus");
386
            }
387
        }
388

    
389

    
390

    
391
        //private bool _IsPageChanged { get; set; }
392
        //public bool IsPageChanged
393
        //{
394
        //    get
395
        //    {
396
        //        return _IsPageChanged;
397
        //    }
398
        //    set
399
        //    {
400
        //        _IsPageChanged = value;
401
        //        OnPropertyChanged("IsPageChanged");
402
        //    }
403
        //}
404

    
405

    
406

    
407
        ///// <summary>
408
        ///// 강인구 추가(Check List관련)
409
        ///// </summary>
410
        //public List<Check_Inferface> Check_Item
411
        //{
412
        //    get
413
        //    {
414
        //        return check_Item;
415
        //    }
416
        //}
417

    
418
        private bool _IsConsolidate { get; set; }
419
        public bool IsConsolidate
420
        {
421
            get
422
            {
423
                return _IsConsolidate;
424
            }
425
            set
426
            {
427
                _IsConsolidate = value;
428
                OnPropertyChanged("IsConsolidate");
429
            }
430
        }
431

    
432
        ////////////////////////////////////////////////
433

    
434

    
435
        #region Angle 관련
436
        private Visibility _AngleVisibility { get; set; }
437
        public Visibility AngleVisibility
438
        {
439
            get
440
            {
441
                return _AngleVisibility;
442
            }
443
            set
444
            {
445
                _AngleVisibility = value;
446
                OnPropertyChanged("AngleVisibility");
447
            }
448

    
449
        }
450

    
451
        public double Angle
452
        {
453
            get
454
            {
455
                return angle;
456
            }
457
            set
458
            {
459
                angle = value;
460
                OnPropertyChanged("Angle");
461
            }
462
        }
463

    
464
        private string _HelperContent { get; set; }
465
        public string HelperContent
466
        {
467
            get
468
            {
469
                return _HelperContent;
470
            }
471
            set
472
            {
473
                _HelperContent = value;
474
                OnPropertyChanged("HelperContent");
475
            }
476
        }
477

    
478
        private string _HelperHeader { get; set; }
479
        public string HelperHeader
480
        {
481
            get
482
            {
483
                return _HelperHeader;
484
            }
485
            set
486
            {
487
                _HelperHeader = value;
488
                OnPropertyChanged("HelperHeader");
489
            }
490
        }
491

    
492
        private bool _HelperExit { get; set; }
493
        public bool HelperExit
494
        {
495
            get
496
            {
497
                return _HelperExit;
498
            }
499
            set
500
            {
501
                _HelperExit = value;
502
                OnPropertyChanged("HelperExit");
503
            }
504
        }
505

    
506
        #endregion
507

    
508
        public event EventHandler<EventArgs> PageLoaded;
509

    
510
        /// <summary>
511
        /// 페이지 변경 후 페이지에 해당하는 마크업을 모두 읽었을때 이벤트를 보내도록 한다.
512
        /// </summary>
513
        public void LoadPageMarkup()
514
        {
515
            if(PageLoaded != null)
516
            {
517
                PageLoaded(this, new EventArgs());
518
            }
519
        }
520

    
521
        public void SetAngleVisible(Visibility visibility)
522
        {
523
            this.AngleVisibility = visibility;
524
        }
525

    
526

    
527
        public ObservableCollection<CommentUserInfo> MarkupControls
528
        {
529
            get
530
            {
531
                return markupControls;
532
            }
533
        }
534

    
535
        public ObservableCollection<CommentUserInfo> MarkupControls_Sync
536
        {
537
            get
538
            {
539
                return markupControls_Sync;
540
            }
541
        }
542
        public int current_page_commentcnt = 0;
543
        public ObservableCollection<CommentUserInfo> MarkupControls_USER
544
        {
545
            get
546
            {
547
                return markupControls_User;
548
            }
549
        }
550

    
551
        public ObservableCollection<Undo_data> UndoDataList
552
        {
553
            get
554
            {
555
                return undoDataList;
556
            }
557
        }
558
        
559
        public StrokeCollection MarkupPens
560
        {
561
            get
562
            {
563
                return markupPens;
564
            }
565

    
566
        }
567

    
568
        #region 버튼 여부
569

    
570
        /// <summary>
571
        /// 상단 Fill 버튼이 클릭 되어있는지
572
        /// </summary>
573
        private bool _checkFillShape { get; set; }
574
        public bool checkFillShape
575
        {
576
            get
577
            {
578
                return _checkFillShape;
579
            }
580
            set
581
            {
582
                _checkFillShape = value;
583
                OnPropertyChanged("checkFillShape");
584
            }
585
        }
586

    
587
        /// <summary>
588
        /// 상단 Hatch 버튼이 클릭 되어있는지
589
        /// </summary>
590
        private bool _checkHatchShape { get; set; }
591
        public bool checkHatchShape
592
        {
593
            get
594
            {
595
                return _checkHatchShape;
596
            }
597
            set
598
            {
599
                _checkHatchShape = value;
600
                OnPropertyChanged("checkHatchShape");
601
            }
602
        }
603

    
604
        private double _controlOpacity { get; set; }
605
        public double ControlOpacity
606
        {
607
            get
608
            {
609
                return _controlOpacity;
610
            }
611
            set
612
            {
613

    
614
                _controlOpacity = value;
615
                OnPropertyChanged("ControlOpacity");
616
            }
617
        }
618

    
619
        private MarkupToPDF.Controls.Common.PaintSet _paintSet { get; set; }
620
        public MarkupToPDF.Controls.Common.PaintSet paintSet
621
        {
622
            get
623
            {
624
                return _paintSet;
625
            }
626
            set
627
            {
628
                _paintSet = value;
629
                OnPropertyChanged("paintSet");
630
            }
631
        }
632

    
633
        /// <summary>
634
        /// 강인구 추가
635
        /// 상단 TextStyle 버튼이 클릭 되어있는지
636
        /// </summary>
637
        private bool _checkTextStyle { get; set; }
638
        public bool checkTextStyle
639
        {
640
            get
641
            {
642
                return _checkTextStyle;
643
            }
644
            set
645
            {
646
                _checkTextStyle = value;
647
                OnPropertyChanged("checkTextStyle");
648
            }
649
        }
650

    
651
        /// <summary>
652
        /// 강인구 추가
653
        /// 상단 TextWeight 버튼이 클릭 되어있는지
654
        /// </summary>
655
        private bool _checkTextWeight { get; set; }
656
        public bool checkTextWeight
657
        {
658
            get
659
            {
660
                return _checkTextWeight;
661
            }
662
            set
663
            {
664
                _checkTextWeight = value;
665
                OnPropertyChanged("checkTextWeight");
666
            }
667
        }
668

    
669
        /// <summary>
670
        /// 강인구 추가
671
        /// 상단 UnderLine 버튼이 클릭 되어있는지
672
        /// </summary>
673
        private bool _checkUnderLine { get; set; }
674
        public bool checkUnderLine
675
        {
676
            get
677
            {
678
                return _checkUnderLine;
679
            }
680
            set
681
            {
682
                _checkUnderLine = value;
683
                OnPropertyChanged("checkUnderLine");
684
            }
685
        }
686

    
687
        /// <summary>
688
        /// 상단 Hatch 버튼이 클릭 되어있는지
689
        /// </summary>
690
        private bool _checkHighShape { get; set; }
691
        public bool checkHighShape
692
        {
693
            get
694
            {
695
                return _checkHighShape;
696
            }
697
            set
698
            {
699
                _checkHighShape = value;
700
                OnPropertyChanged("checkHighShape");
701
            }
702
        }
703

    
704
        /// <summary>
705
        /// 상단 Axis 버튼이 클릭 되어있는지
706
        /// </summary>
707
        private bool _IsAxisLock { get; set; }
708
        public bool IsAxisLock
709
        {
710
            get
711
            {
712
                return _IsAxisLock;
713
            }
714
            set
715
            {
716
                _IsAxisLock = value;
717
                OnPropertyChanged("IsAxisLock");
718
            }
719
        }
720

    
721
        /// <summary>
722
        /// 상단 Highlight 버튼이 클릭 되어있는지
723
        /// </summary>
724
        private bool _checkHighlight { get; set; }
725
        public bool checkHighlight
726
        {
727
            get
728
            {
729
                return _checkHighlight;
730
            }
731
            set
732
            {
733
                _checkHighlight = value;
734
                OnPropertyChanged("checkHighlight");
735
            }
736
        }
737

    
738
        /// <summary>
739
        /// 강인구 추가
740
        /// 상단 TextWeight 버튼이 클릭 되어있는지
741
        /// </summary>
742
        private double _TextSize { get; set; }
743
        public double TextSize
744
        {
745
            get
746
            {
747
                return _TextSize;
748
            }
749
            set
750
            {
751
                _TextSize = value;
752
                OnPropertyChanged("TextSize");
753
            }
754
        }
755
        #endregion
756

    
757
        public ImageBrush BackgroundImage
758
        {
759
            get
760
            {
761
                return backgroundImage;
762
            }
763
            set
764
            {
765
                backgroundImage = value;
766
                OnPropertyChanged("BackgroundImage");
767
            }
768
        }
769

    
770
        public ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> Document_Info
771
        {
772
            get
773
            {
774
                return document_Info;
775
            }
776
        }
777

    
778
        public double ContentScale
779
        {
780
            get
781
            {
782
                return contentScale;
783
            }
784
            set
785
            {
786
                contentScale = value;
787

    
788
                double minOffsetX = 0.0;
789
                double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth);
790
                contentOffsetX = Math.Min(Math.Max(contentOffsetX, minOffsetX), maxOffsetX);
791

    
792
                double minOffsetY = 0.0;
793
                double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight);
794
                contentOffsetY = Math.Min(Math.Max(contentOffsetY, minOffsetY), maxOffsetY);
795

    
796
                OnPropertyChanged("ContentScale");
797
            }
798
        }
799

    
800
        public double Sync_ContentScale
801
        {
802
            get
803
            {
804
                return Sync_contentScale;
805
            }
806
            set
807
            {
808
                Sync_contentScale = value;
809
                OnPropertyChanged("Sync_ContentScale");
810
            }
811
        }
812

    
813
        public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoList
814
        {
815
            get
816
            {
817
                return markupInfoList;
818
            }
819
            set
820
            {
821
                markupInfoList = value;
822
                OnPropertyChanged("_markupInfoList");
823
            }
824
        }
825

    
826
        public ObservableCollection<MarkupUserInfo> _markupUserList
827
        {
828
            get
829
            {
830
                return markupUserList;
831
            }
832
            set
833
            {
834
                markupUserList = value;
835
                OnPropertyChanged("_markupUserList");
836
            }
837
        }
838

    
839
        public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoRevList
840
        {
841
            get
842
            {
843
                return markupInfoRevList;
844
            }
845
            set
846
            {
847
                markupInfoRevList = value;
848
                OnPropertyChanged("_markupInfoRevList");
849
            }
850
        }
851

    
852
        public double ContentOffsetX
853
        {
854
            get
855
            {
856
                return contentOffsetX;
857
            }
858
            set
859
            {
860
                double minOffsetX = 0.0;
861
                double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth);
862
                contentOffsetX = Math.Min(Math.Max(value, minOffsetX), maxOffsetX);
863
                OnPropertyChanged("ContentOffsetX");
864
            }
865
        }
866

    
867
        public double ContentOffsetY
868
        {
869
            get
870
            {
871
                return contentOffsetY;
872
            }
873
            set
874
            {
875
                double minOffsetY = 0.0;
876
                double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight);
877
                contentOffsetY = Math.Min(Math.Max(value, minOffsetY), maxOffsetY);
878
                OnPropertyChanged("ContentOffsetY");
879
            }
880
        }
881

    
882
        public double Sync_ContentOffsetX
883
        {
884
            get
885
            {
886
                return Sync_contentOffsetX;
887
            }
888
            set
889
            {
890
                Sync_contentOffsetX = value;
891
                OnPropertyChanged("Sync_ContentOffsetX");
892
            }
893
        }
894

    
895
        public double Sync_ContentOffsetY
896
        {
897
            get
898
            {
899
                return Sync_contentOffsetY;
900
            }
901
            set
902
            {
903
                Sync_contentOffsetY = value;
904
                OnPropertyChanged("Sync_ContentOffsetY");
905
            }
906
        }
907

    
908
        public MessageCollection k_talkMessageSet
909
        {
910
            get
911
            {
912
                if (_k_talkMessageSet == null)
913
                {
914
                    _k_talkMessageSet = new MessageCollection();
915
                }
916
                return _k_talkMessageSet;
917
            }
918
            set
919
            {
920
                _k_talkMessageSet = value;
921
                OnPropertyChanged("k_talkMessageSet");
922
            }
923
        }
924

    
925
        public double ContentWidth
926
        {
927
            get
928
            {
929
                return contentWidth;
930
            }
931
            set
932
            {
933
                contentWidth = value;
934
                OnPropertyChanged("ContentWidth");
935
            }
936
        }
937

    
938
        public double ContentHeight
939
        {
940
            get
941
            {
942
                return contentHeight;
943
            }
944
            set
945
            {
946
                contentHeight = value;
947
                OnPropertyChanged("ContentHeight");
948
            }
949
        }
950

    
951
        public double ContentViewportWidth
952
        {
953
            get
954
            {
955
                return contentViewportWidth;
956
            }
957
            set
958
            {
959
                contentViewportWidth = value;
960
                OnPropertyChanged("ContentViewportWidth");
961
            }
962
        }
963

    
964
        public double ContentViewportHeight
965
        {
966
            get
967
            {
968
                return contentViewportHeight;
969
            }
970
            set
971
            {
972
                contentViewportHeight = value;
973
                OnPropertyChanged("ContentViewportHeight");
974
            }
975
        }
976

    
977
        public MainWindow SystemMain { get; set; }
978

    
979
        private bool _PageBalanceMode { get; set; }
980
        public bool PageBalanceMode
981
        {
982
            get
983
            {
984
                return _PageBalanceMode;
985
            }
986
            set
987
            {
988
                _PageBalanceMode = value;
989
                OnPropertyChanged("PageBalanceMode");
990
            }
991
        }
992

    
993
        private int _PageBalanceNumber { get; set; }
994
        public int PageBalanceNumber
995
        {
996
            get
997
            {
998
                return _PageBalanceNumber;
999
            }
1000
            set
1001
            {
1002
                _PageBalanceNumber = value;
1003
                OnPropertyChanged("PageBalanceNumber");
1004
            }
1005
        }
1006

    
1007
        private int _PageNumber { get; set; }
1008
        public int PageNumber
1009
        {
1010
            get
1011
            {
1012
                return _PageNumber;
1013
            }
1014
            set
1015
            {
1016
                _PageNumber = value;
1017
                OnPropertyChanged("PageNumber");
1018
            }
1019
        }
1020

    
1021
        public double AngleOffsetX
1022
        {
1023
            get
1024
            {
1025
                return angleOffsetX;
1026
            }
1027
            set
1028
            {
1029
                angleOffsetX = value;
1030
                OnPropertyChanged("AngleOffsetX");
1031
            }
1032
        }
1033

    
1034
        public double AngleOffsetY
1035
        {
1036
            get
1037
            {
1038
                return angleOffsetY;
1039
            }
1040
            set
1041
            {
1042
                angleOffsetY = value;
1043
                OnPropertyChanged("AngleOffsetY");
1044
            }
1045
        }
1046

    
1047
        //강인구 추가(체크리스트)
1048
        private string _CheckList_ID { get; set; }
1049
        public string CheckList_ID
1050
        {
1051
            get
1052
            {
1053
                return _CheckList_ID;
1054
            }
1055
            set
1056
            {
1057
                _CheckList_ID = value;
1058
                OnPropertyChanged("CheckList_ID");
1059
            }
1060
        }
1061
        //강인구 추가(캡쳐 모드)
1062
        private double _Capture_Opacity { get; set; }
1063
        public double Capture_Opacity
1064
        {
1065
            get
1066
            {
1067
                return _Capture_Opacity;
1068
            }
1069
            set
1070
            {
1071
                _Capture_Opacity = value;
1072
                OnPropertyChanged("Capture_Opacity");
1073
            }
1074
        }
1075

    
1076
        private Visibility _ViewVisible { get; set; }
1077
        public Visibility ViewVisible
1078
        {
1079
            get
1080
            {
1081
                return _ViewVisible;
1082
            }
1083
            set
1084
            {
1085
                _ViewVisible = value;
1086
                OnPropertyChanged("ViewVisible");
1087
            }
1088
        }
1089

    
1090
        private bool _IsSync { get; set; }
1091
        public bool IsSync
1092
        {
1093
            get
1094
            {
1095
                return _IsSync;
1096
            }
1097
            set
1098
            {
1099
                _IsSync = value;
1100
                OnPropertyChanged("IsSync");
1101
            }
1102
        }
1103

    
1104
        private System.Windows.Media.Imaging.BitmapFrame _ImageViewPath;
1105
        public System.Windows.Media.Imaging.BitmapFrame ImageViewPath
1106
        {
1107
            get
1108
            {
1109
                return _ImageViewPath;
1110
            }
1111
            set
1112
            {
1113
                _ImageViewPath = value;
1114
                OnPropertyChanged("ImageViewPath");
1115
            }
1116
        }
1117
        private double _ImageViewWidth { get; set; }
1118
        public double ImageViewWidth
1119
        {
1120
            get
1121
            {
1122
                return _ImageViewWidth;
1123
            }
1124
            set
1125
            {
1126
                _ImageViewWidth = value;
1127
                OnPropertyChanged("ImageViewWidth");
1128
            }
1129
        }
1130
        private double _ImageViewHeight { get; set; }
1131
        public double ImageViewHeight
1132
        {
1133
            get
1134
            {
1135
                return _ImageViewHeight;
1136
            }
1137
            set
1138
            {
1139
                _ImageViewHeight = value;
1140
                OnPropertyChanged("ImageViewHeight");
1141
            }
1142
        }
1143

    
1144
        private System.Windows.Media.Imaging.BitmapImage _ImageViewPath_C;
1145
        public System.Windows.Media.Imaging.BitmapImage ImageViewPath_C
1146
        {
1147
            get
1148
            {
1149
                return _ImageViewPath_C;
1150
            }
1151
            set
1152
            {
1153
                _ImageViewPath_C = value;
1154
                OnPropertyChanged("ImageViewPath_C");
1155
            }
1156
        }
1157
        private double _ImageViewWidth_C { get; set; }
1158
        public double ImageViewWidth_C
1159
        {
1160
            get
1161
            {
1162
                return _ImageViewWidth_C;
1163
            }
1164
            set
1165
            {
1166
                _ImageViewWidth_C = value;
1167
                OnPropertyChanged("ImageViewWidth_C");
1168
            }
1169
        }
1170
        private double _ImageViewHeight_C { get; set; }
1171
        public double ImageViewHeight_C
1172
        {
1173
            get
1174
            {
1175
                return _ImageViewHeight_C;
1176
            }
1177
            set
1178
            {
1179
                _ImageViewHeight_C = value;
1180
                OnPropertyChanged("ImageViewHeight_C");
1181
            }
1182
        }
1183

    
1184

    
1185
        #endregion Property Member
1186

    
1187
        public System.IO.Stream GetStreamFromUrl(string url)
1188
        {
1189
            byte[] imageData = null;
1190

    
1191
            using (var wc = new System.Net.WebClient())
1192
                imageData = wc.DownloadData(url);
1193

    
1194
            return new System.IO.MemoryStream(imageData);
1195
        }
1196

    
1197
        public ViewerDataModel()
1198
        {
1199
            //rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue));
1200
            //rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green));
1201
            //rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple));
1202
            //rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red));
1203

    
1204
            //RectangleControl rect1 = new RectangleControl();
1205
            //rect1.StartPoint = new Point(50, 50);
1206
            //rect1.LeftBottomPoint = new Point(100, 50);
1207
            //rect1.TopRightPoint = new Point(50, 100);
1208
            //rect1.EndPoint = new Point(100, 100);
1209
            //rect1.FillColor = new SolidColorBrush(Colors.Red);
1210
            //rectangles.Add(rect1);
1211
            //
1212
            // Populate the data model with some example data.
1213
            //
1214
            //rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue));
1215
            //rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green));
1216
            //rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple));
1217
            //rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red));
1218

    
1219
            this.ControlOpacity = 1;
1220

    
1221
            /* Default
1222
             LineSize = 3, TextSize = 30, Interval = 10, ArcLength = 10, SaveInterval = 5
1223
            */            
1224
            this.LineSize = KCOM.Properties.Settings.Default.LineSize;
1225

    
1226
            this.TextSize = KCOM.Properties.Settings.Default.TextSize;
1227

    
1228
            this.Interval = KCOM.Properties.Settings.Default.Interval;
1229

    
1230
            this.ArcLength = KCOM.Properties.Settings.Default.ArcLength;
1231

    
1232
            this.DashSize = new DoubleCollection();
1233

    
1234
            this.SaveInterval = KCOM.Properties.Settings.Default.SaveInterval;
1235
            this.AngleVisibility = Visibility.Collapsed;
1236
        }
1237

    
1238

    
1239
        public List<IKCOM.MarkupInfoItem> SelectedmarkupInfoItems { get; set; }
1240
       
1241
        #region INotifyPropertyChanged Event
1242

    
1243
        private void OnPropertyChanged(string name)
1244
        {
1245
            if (PropertyChanged != null)
1246
            {
1247
                PropertyChanged(this, new PropertyChangedEventArgs(name));
1248
            }
1249
        }
1250

    
1251
        public event PropertyChangedEventHandler PropertyChanged;
1252

    
1253
        #endregion
1254
    }
1255
}
클립보드 이미지 추가 (최대 크기: 500 MB)