프로젝트

일반

사용자정보

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

markus / KCOM / Common / ViewerDataModel.cs @ 9d5b4bc2

이력 | 보기 | 이력해설 | 다운로드 (32.9 KB)

1
using KCOM.Events;
2
using KCOM.Messenger;
3
using KCOMDataModel.DataModel;
4
//using Leadtools;
5
using MarkupToPDF.Common;
6
using Newtonsoft.Json;
7
using System;
8
using System.Collections;
9
using System.Collections.Generic;
10
using System.Collections.ObjectModel;
11
using System.ComponentModel;
12
using System.IO;
13
using System.Linq;
14
using System.Text;
15
using System.Threading.Tasks;
16
using System.Windows;
17
using System.Windows.Controls;
18
using System.Windows.Ink;
19
using System.Windows.Media;
20
using System.Xml;
21
using System.Xml.Serialization;
22
//using IKCOM;
23

    
24
namespace KCOM.Common
25
{
26
    public class ViewerDataModel : INotifyPropertyChanged
27
    {
28

    
29
        System.Threading.CancellationTokenSource TokenSource;
30

    
31
        public System.Threading.CancellationToken CancellationToken()
32
        {
33
            return TokenSource.Token;
34
        }
35

    
36
        public System.Threading.CancellationToken NewCancellationToken()
37
        {
38
            if (TokenSource != null)
39
            {
40
                System.Diagnostics.Debug.WriteLine("cancel Token");
41
                TokenSource.Cancel();
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 angle = 0;
123

    
124
        private double angleOffsetX = 0;
125

    
126
        private double angleOffsetY = 0;
127

    
128
        private ImageBrush backgroundImage;
129

    
130
        //private RasterImage _rasterimage;
131

    
132

    
133
        #endregion Data Members
134

    
135
        #region Property Member
136

    
137
        public bool IsWheelPageChanage = false;
138

    
139
        public static ViewerDataModel Instance
140
        {
141
            get
142
            {
143
                return instance;
144
            }
145
        }
146

    
147
        private bool isDownloadOriginal;
148
        public bool IsDownloadOriginal
149
        {
150
            get => isDownloadOriginal;
151
            set
152
            {
153
                if (isDownloadOriginal != value)
154
                {
155
                    isDownloadOriginal = value;
156
                    OnPropertyChanged("IsDownloadOriginal");
157
                }
158
            }
159
        }
160

    
161
        private bool isAdmin;
162
        public bool IsAdmin
163
        {
164
            //get => true;
165
            get => isAdmin;
166
            set
167
            {
168
                isAdmin = value;
169
                OnPropertyChanged("IsAdmin");
170
            }
171
        }
172

    
173
        private bool isDocumentHistory;
174
        public bool IsDocumentHistory
175
        {
176
            get => isDocumentHistory;
177
            set
178
            {
179
                isDocumentHistory = value;
180
                OnPropertyChanged("IsDocumentHistory");
181
            }
182
        }
183

    
184
        private bool isDownloadCancel;
185
        public bool IsDownloadCancel
186
        {
187
            get => isDownloadCancel;
188
            set
189
            {
190
                if (isDownloadCancel != value)
191
                {
192
                    isDownloadCancel = value;
193
                    OnPropertyChanged("IsDownloadCancel");
194
                }
195
            }
196
        }
197

    
198
        private int downloadFileProgress;
199
        public int DownloadFileProgress
200
        {
201
            get => downloadFileProgress;
202
            set
203
            {
204
                if (downloadFileProgress != value)
205
                {
206
                    downloadFileProgress = value;
207
                    OnPropertyChanged("DownloadFileProgress");
208
                }
209
            }
210
        }
211

    
212
        private string originalTempFile;
213
        public string OriginalTempFile
214
        {
215
            get => originalTempFile;
216
            set
217
            {
218
                if (originalTempFile != value)
219
                {
220
                    originalTempFile = value;
221
                    OnPropertyChanged("OriginalTempFile");
222
                }
223
            }
224
        }
225

    
226
        private List<IKCOM.MarkupItemEx> _MarkupList_MY { get; set; }
227
        public List<IKCOM.MarkupItemEx> MarkupList_MY
228
        {
229
            get
230
            {
231
                if (_MarkupList_MY == null)
232
                {
233
                    _MarkupList_MY = new List<IKCOM.MarkupItemEx>();
234
                }
235

    
236
                return _MarkupList_MY;
237
            }
238
            set
239
            {
240

    
241
                _MarkupList_MY = value;
242
                OnPropertyChanged("MarkupList_MY");
243
            }
244
        }
245

    
246
        private List<IKCOM.MarkupItemEx> _MarkupList_USER { get; set; }
247
        public List<IKCOM.MarkupItemEx> MyMarkupList
248
        {
249
            get
250
            {
251
                if (_MarkupList_USER == null)
252
                {
253
                    _MarkupList_USER = new List<IKCOM.MarkupItemEx>();
254
                }
255

    
256
                return _MarkupList_USER;
257
            }
258
            set
259
            {
260

    
261
                _MarkupList_USER = value;
262
                OnPropertyChanged("_MarkupList_USER");
263
            }
264
        }
265

    
266
        private List<IKCOM.MarkupItemEx> _MarkupList_Pre { get; set; }
267
        public List<IKCOM.MarkupItemEx> MarkupList_Pre
268
        {
269
            get
270
            {
271
                if (_MarkupList_Pre == null)
272
                {
273
                    _MarkupList_Pre = new List<IKCOM.MarkupItemEx>();
274
                }
275

    
276
                return _MarkupList_Pre;
277
            }
278
            set
279
            {
280

    
281
                _MarkupList_Pre = value;
282
                OnPropertyChanged("MarkupList_Pre");
283
            }
284

    
285
        }
286

    
287
        private System.IO.FileInfo _searchPDF { get; set; }
288
        public System.IO.FileInfo searchPDF
289
        {
290
            get
291
            {
292
                return _searchPDF;
293
            }
294
            set
295
            {
296
                _searchPDF = value;
297
                OnPropertyChanged("searchPDF");
298
            }
299
        }
300

    
301

    
302
        /// <summary>
303
        /// 현재 상단 메뉴에서 선택된 컨트롤
304
        /// </summary>
305
        private string _SelectedControl { get; set; }
306
        public string SelectedControl
307
        {
308
            get
309
            {
310
                return _SelectedControl;
311
            }
312
            set
313
            {
314
                _SelectedControl = value;
315
                OnPropertyChanged("SelectedControl");
316
            }
317
        }
318

    
319

    
320
        /// <summary>
321
        /// 현재 상단 메뉴의 선 굵기값
322
        /// </summary>
323
        private double _LineSize { get; set; }
324
        public double LineSize
325
        {
326
            get
327
            {
328
                return _LineSize;
329
            }
330
            set
331
            {
332
                _LineSize = value;
333
                OnPropertyChanged("LineSize");
334
            }
335
        }
336

    
337
        private double _Interval { get; set; }
338
        public double Interval
339
        {
340
            get
341
            {
342
                return _Interval;
343
            }
344
            set
345
            {
346
                _Interval = value;
347
                OnPropertyChanged("Interval");
348
            }
349
        }
350
        private double _SaveInterval { get; set; }
351
        public double SaveInterval
352
        {
353
            get
354
            {
355
                return _SaveInterval;
356
            }
357
            set
358
            {
359
                _SaveInterval = value;
360
                OnPropertyChanged("SaveInterval");
361
            }
362
        }
363
        private double _ArcLength { get; set; }
364
        public double ArcLength
365
        {
366
            get
367
            {
368
                return _ArcLength;
369
            }
370
            set
371
            {
372
                _ArcLength = value;
373
                OnPropertyChanged("ArcLength");
374
            }
375
        }
376

    
377
        public bool IsPressShift
378
        {
379
            get
380
            {
381
                return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Shift) == System.Windows.Input.ModifierKeys.Shift);
382
            }
383
        }
384

    
385
        public bool IsPressCtrl
386
        {
387
            get
388
            {
389
                return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Control) == System.Windows.Input.ModifierKeys.Control);
390
            }
391
        }
392

    
393
        /// <summary>
394
        /// Dash 사이즈 
395
        /// </summary>
396
        private DoubleCollection _DashSize { get; set; }
397
        public DoubleCollection DashSize
398
        {
399
            get
400
            {
401
                return _DashSize;
402
            }
403
            set
404
            {
405
                _DashSize = value;
406
                OnPropertyChanged("DashSize");
407
            }
408
        }
409

    
410
        private string _ControlTag { get; set; }
411
        public string ControlTag
412
        {
413
            get
414
            {
415
                return _ControlTag;
416
            }
417
            set
418
            {
419
                _ControlTag = value;
420
                OnPropertyChanged("ControlTag");
421
            }
422
        }
423

    
424
        private string _CheckStatus { get; set; }
425
        public string CheckStatus
426
        {
427
            get
428
            {
429
                return _CheckStatus;
430
            }
431
            set
432
            {
433
                _CheckStatus = value;
434
                OnPropertyChanged("CheckStatus");
435
            }
436
        }
437

    
438

    
439

    
440
        //private bool _IsPageChanged { get; set; }
441
        //public bool IsPageChanged
442
        //{
443
        //    get
444
        //    {
445
        //        return _IsPageChanged;
446
        //    }
447
        //    set
448
        //    {
449
        //        _IsPageChanged = value;
450
        //        OnPropertyChanged("IsPageChanged");
451
        //    }
452
        //}
453

    
454

    
455

    
456
        ///// <summary>
457
        ///// 강인구 추가(Check List관련)
458
        ///// </summary>
459
        //public List<Check_Inferface> Check_Item
460
        //{
461
        //    get
462
        //    {
463
        //        return check_Item;
464
        //    }
465
        //}
466

    
467
        private bool _IsConsolidate { get; set; }
468
        public bool IsConsolidate
469
        {
470
            get
471
            {
472
                return _IsConsolidate;
473
            }
474
            set
475
            {
476
                _IsConsolidate = value;
477
                OnPropertyChanged("IsConsolidate");
478
            }
479
        }
480

    
481
        ////////////////////////////////////////////////
482

    
483

    
484
        #region Angle 관련
485
        private Visibility _AngleVisibility { get; set; }
486
        public Visibility AngleVisibility
487
        {
488
            get
489
            {
490
                return _AngleVisibility;
491
            }
492
            set
493
            {
494
                _AngleVisibility = value;
495
                OnPropertyChanged("AngleVisibility");
496
            }
497

    
498
        }
499

    
500
        public double Angle
501
        {
502
            get
503
            {
504
                return angle;
505
            }
506
            set
507
            {
508
                angle = value;
509
                OnPropertyChanged("Angle");
510
            }
511
        }
512

    
513
        private string _HelperContent { get; set; }
514
        public string HelperContent
515
        {
516
            get
517
            {
518
                return _HelperContent;
519
            }
520
            set
521
            {
522
                _HelperContent = value;
523
                OnPropertyChanged("HelperContent");
524
            }
525
        }
526

    
527
        private string _HelperHeader { get; set; }
528
        public string HelperHeader
529
        {
530
            get
531
            {
532
                return _HelperHeader;
533
            }
534
            set
535
            {
536
                _HelperHeader = value;
537
                OnPropertyChanged("HelperHeader");
538
            }
539
        }
540

    
541
        private bool _HelperExit { get; set; }
542
        public bool HelperExit
543
        {
544
            get
545
            {
546
                return _HelperExit;
547
            }
548
            set
549
            {
550
                _HelperExit = value;
551
                OnPropertyChanged("HelperExit");
552
            }
553
        }
554

    
555
        #endregion
556

    
557
        public event EventHandler<EventArgs> PageLoaded;
558

    
559
        /// <summary>
560
        /// 페이지 변경 후 페이지에 해당하는 마크업을 모두 읽었을때 이벤트를 보내도록 한다.
561
        /// </summary>
562
        public void LoadPageMarkupFinish()
563
        {
564
            if(PageLoaded != null)
565
            {
566
                PageLoaded(this, new EventArgs());
567
            }
568
        }
569

    
570
        public void SetAngleVisible(Visibility visibility)
571
        {
572
            this.AngleVisibility = visibility;
573
        }
574

    
575

    
576
        public ObservableCollection<CommentUserInfo> MarkupControls
577
        {
578
            get
579
            {
580
                return markupControls;
581
            }
582
        }
583

    
584
        public ObservableCollection<CommentUserInfo> MarkupControls_Sync
585
        {
586
            get
587
            {
588
                return markupControls_Sync;
589
            }
590
        }
591
        public int current_page_commentcnt = 0;
592
        public ObservableCollection<CommentUserInfo> MarkupControls_USER
593
        {
594
            get
595
            {
596
                return markupControls_User;
597
            }
598
        }
599

    
600
        public ObservableCollection<Undo_data> UndoDataList
601
        {
602
            get
603
            {
604
                return undoDataList;
605
            }
606
        }
607
        
608
        public StrokeCollection MarkupPens
609
        {
610
            get
611
            {
612
                return markupPens;
613
            }
614

    
615
        }
616

    
617
        #region 버튼 여부
618

    
619
        /// <summary>
620
        /// 상단 Fill 버튼이 클릭 되어있는지
621
        /// </summary>
622
        private bool _checkFillShape { get; set; }
623
        public bool checkFillShape
624
        {
625
            get
626
            {
627
                return _checkFillShape;
628
            }
629
            set
630
            {
631
                _checkFillShape = value;
632
                OnPropertyChanged("checkFillShape");
633
            }
634
        }
635

    
636
        /// <summary>
637
        /// 상단 Hatch 버튼이 클릭 되어있는지
638
        /// </summary>
639
        private bool _checkHatchShape { get; set; }
640
        public bool checkHatchShape
641
        {
642
            get
643
            {
644
                return _checkHatchShape;
645
            }
646
            set
647
            {
648
                _checkHatchShape = value;
649
                OnPropertyChanged("checkHatchShape");
650
            }
651
        }
652

    
653
        private double _controlOpacity { get; set; }
654
        public double ControlOpacity
655
        {
656
            get
657
            {
658
                return _controlOpacity;
659
            }
660
            set
661
            {
662

    
663
                _controlOpacity = value;
664
                OnPropertyChanged("ControlOpacity");
665
            }
666
        }
667

    
668
        private MarkupToPDF.Controls.Common.PaintSet _paintSet { get; set; }
669
        public MarkupToPDF.Controls.Common.PaintSet paintSet
670
        {
671
            get
672
            {
673
                return _paintSet;
674
            }
675
            set
676
            {
677
                _paintSet = value;
678
                OnPropertyChanged("paintSet");
679
            }
680
        }
681

    
682
        /// <summary>
683
        /// 강인구 추가
684
        /// 상단 TextStyle 버튼이 클릭 되어있는지
685
        /// </summary>
686
        private bool _checkTextStyle { get; set; }
687
        public bool checkTextStyle
688
        {
689
            get
690
            {
691
                return _checkTextStyle;
692
            }
693
            set
694
            {
695
                _checkTextStyle = value;
696
                OnPropertyChanged("checkTextStyle");
697
            }
698
        }
699

    
700
        /// <summary>
701
        /// 강인구 추가
702
        /// 상단 TextWeight 버튼이 클릭 되어있는지
703
        /// </summary>
704
        private bool _checkTextWeight { get; set; }
705
        public bool checkTextWeight
706
        {
707
            get
708
            {
709
                return _checkTextWeight;
710
            }
711
            set
712
            {
713
                _checkTextWeight = value;
714
                OnPropertyChanged("checkTextWeight");
715
            }
716
        }
717

    
718
        /// <summary>
719
        /// 강인구 추가
720
        /// 상단 UnderLine 버튼이 클릭 되어있는지
721
        /// </summary>
722
        private bool _checkUnderLine { get; set; }
723
        public bool checkUnderLine
724
        {
725
            get
726
            {
727
                return _checkUnderLine;
728
            }
729
            set
730
            {
731
                _checkUnderLine = value;
732
                OnPropertyChanged("checkUnderLine");
733
            }
734
        }
735

    
736
        /// <summary>
737
        /// 상단 Hatch 버튼이 클릭 되어있는지
738
        /// </summary>
739
        private bool _checkHighShape { get; set; }
740
        public bool checkHighShape
741
        {
742
            get
743
            {
744
                return _checkHighShape;
745
            }
746
            set
747
            {
748
                _checkHighShape = value;
749
                OnPropertyChanged("checkHighShape");
750
            }
751
        }
752

    
753
        /// <summary>
754
        /// 상단 Axis 버튼이 클릭 되어있는지
755
        /// </summary>
756
        private bool _IsAxisLock { get; set; }
757
        public bool IsAxisLock
758
        {
759
            get
760
            {
761
                return _IsAxisLock;
762
            }
763
            set
764
            {
765
                _IsAxisLock = value;
766
                OnPropertyChanged("IsAxisLock");
767
            }
768
        }
769

    
770
        /// <summary>
771
        /// 상단 Highlight 버튼이 클릭 되어있는지
772
        /// </summary>
773
        private bool _checkHighlight { get; set; }
774
        public bool checkHighlight
775
        {
776
            get
777
            {
778
                return _checkHighlight;
779
            }
780
            set
781
            {
782
                _checkHighlight = value;
783
                OnPropertyChanged("checkHighlight");
784
            }
785
        }
786

    
787
        /// <summary>
788
        /// 강인구 추가
789
        /// 상단 TextWeight 버튼이 클릭 되어있는지
790
        /// </summary>
791
        private double _TextSize { get; set; }
792
        public double TextSize
793
        {
794
            get
795
            {
796
                return _TextSize;
797
            }
798
            set
799
            {
800
                _TextSize = value;
801
                OnPropertyChanged("TextSize");
802
            }
803
        }
804
        #endregion
805

    
806
        public ImageBrush BackgroundImage
807
        {
808
            get
809
            {
810
                return backgroundImage;
811
            }
812
            set
813
            {
814
                backgroundImage = value;
815
                OnPropertyChanged("BackgroundImage");
816
            }
817
        }
818

    
819
        public ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> Document_Info
820
        {
821
            get
822
            {
823
                return document_Info;
824
            }
825
        }
826

    
827
        public double ContentScale
828
        {
829
            get
830
            {
831
                return contentScale;
832
            }
833
            set
834
            {
835
                contentScale = value;
836

    
837
                double minOffsetX = 0.0;
838
                double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth);
839
                contentOffsetX = Math.Min(Math.Max(contentOffsetX, minOffsetX), maxOffsetX);
840

    
841
                double minOffsetY = 0.0;
842
                double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight);
843
                contentOffsetY = Math.Min(Math.Max(contentOffsetY, minOffsetY), maxOffsetY);
844

    
845
                OnPropertyChanged("ContentScale");
846
            }
847
        }
848

    
849
        public double Sync_ContentScale
850
        {
851
            get
852
            {
853
                return Sync_contentScale;
854
            }
855
            set
856
            {
857
                Sync_contentScale = value;
858
                OnPropertyChanged("Sync_ContentScale");
859
            }
860
        }
861

    
862
        public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoList
863
        {
864
            get
865
            {
866
                return markupInfoList;
867
            }
868
            set
869
            {
870
                markupInfoList = value;
871
                OnPropertyChanged("_markupInfoList");
872
            }
873
        }
874

    
875
        public ObservableCollection<MarkupUserInfo> _markupUserList
876
        {
877
            get
878
            {
879
                return markupUserList;
880
            }
881
            set
882
            {
883
                markupUserList = value;
884
                OnPropertyChanged("_markupUserList");
885
            }
886
        }
887

    
888
        public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoRevList
889
        {
890
            get
891
            {
892
                return markupInfoRevList;
893
            }
894
            set
895
            {
896
                markupInfoRevList = value;
897
                OnPropertyChanged("_markupInfoRevList");
898
            }
899
        }
900

    
901
        public double ContentOffsetX
902
        {
903
            get
904
            {
905
                return contentOffsetX;
906
            }
907
            set
908
            {
909
                double minOffsetX = 0.0;
910
                double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth);
911
                contentOffsetX = Math.Min(Math.Max(value, minOffsetX), maxOffsetX);
912
                OnPropertyChanged("ContentOffsetX");
913
            }
914
        }
915

    
916
        public double ContentOffsetY
917
        {
918
            get
919
            {
920
                return contentOffsetY;
921
            }
922
            set
923
            {
924
                double minOffsetY = 0.0;
925
                double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight);
926
                contentOffsetY = Math.Min(Math.Max(value, minOffsetY), maxOffsetY);
927
                OnPropertyChanged("ContentOffsetY");
928
            }
929
        }
930

    
931
        public double Sync_ContentOffsetX
932
        {
933
            get
934
            {
935
                return Sync_contentOffsetX;
936
            }
937
            set
938
            {
939
                Sync_contentOffsetX = value;
940
                OnPropertyChanged("Sync_ContentOffsetX");
941
            }
942
        }
943

    
944
        public double Sync_ContentOffsetY
945
        {
946
            get
947
            {
948
                return Sync_contentOffsetY;
949
            }
950
            set
951
            {
952
                Sync_contentOffsetY = value;
953
                OnPropertyChanged("Sync_ContentOffsetY");
954
            }
955
        }
956

    
957
        public MessageCollection k_talkMessageSet
958
        {
959
            get
960
            {
961
                if (_k_talkMessageSet == null)
962
                {
963
                    _k_talkMessageSet = new MessageCollection();
964
                }
965
                return _k_talkMessageSet;
966
            }
967
            set
968
            {
969
                _k_talkMessageSet = value;
970
                OnPropertyChanged("k_talkMessageSet");
971
            }
972
        }
973

    
974
        public double ContentWidth
975
        {
976
            get
977
            {
978
                return contentWidth;
979
            }
980
            set
981
            {
982
                contentWidth = value;
983
                OnPropertyChanged("ContentWidth");
984
            }
985
        }
986

    
987
        public double ContentHeight
988
        {
989
            get
990
            {
991
                return contentHeight;
992
            }
993
            set
994
            {
995
                contentHeight = value;
996
                OnPropertyChanged("ContentHeight");
997
            }
998
        }
999

    
1000
        public double ContentViewportWidth
1001
        {
1002
            get
1003
            {
1004
                return contentViewportWidth;
1005
            }
1006
            set
1007
            {
1008
                contentViewportWidth = value;
1009
                OnPropertyChanged("ContentViewportWidth");
1010
            }
1011
        }
1012

    
1013
        public double ContentViewportHeight
1014
        {
1015
            get
1016
            {
1017
                return contentViewportHeight;
1018
            }
1019
            set
1020
            {
1021
                contentViewportHeight = value;
1022
                OnPropertyChanged("ContentViewportHeight");
1023
            }
1024
        }
1025

    
1026
        public MainWindow SystemMain { get; set; }
1027

    
1028
        private bool _PageBalanceMode { get; set; }
1029
        public bool PageBalanceMode
1030
        {
1031
            get
1032
            {
1033
                return _PageBalanceMode;
1034
            }
1035
            set
1036
            {
1037
                _PageBalanceMode = value;
1038
                OnPropertyChanged("PageBalanceMode");
1039
            }
1040
        }
1041

    
1042
        private int _PageBalanceNumber { get; set; }
1043
        public int PageBalanceNumber
1044
        {
1045
            get
1046
            {
1047
                return _PageBalanceNumber;
1048
            }
1049
            set
1050
            {
1051
                _PageBalanceNumber = value;
1052
                OnPropertyChanged("PageBalanceNumber");
1053
            }
1054
        }
1055

    
1056
        private int _PageNumber { get; set; }
1057
        public int PageNumber
1058
        {
1059
            get
1060
            {
1061
                return _PageNumber;
1062
            }
1063
            set
1064
            {
1065
                _PageNumber = value;
1066
                OnPropertyChanged("PageNumber");
1067
            }
1068
        }
1069

    
1070
        public double AngleOffsetX
1071
        {
1072
            get
1073
            {
1074
                return angleOffsetX;
1075
            }
1076
            set
1077
            {
1078
                angleOffsetX = value;
1079
                OnPropertyChanged("AngleOffsetX");
1080
            }
1081
        }
1082

    
1083
        public double AngleOffsetY
1084
        {
1085
            get
1086
            {
1087
                return angleOffsetY;
1088
            }
1089
            set
1090
            {
1091
                angleOffsetY = value;
1092
                OnPropertyChanged("AngleOffsetY");
1093
            }
1094
        }
1095

    
1096
        //강인구 추가(체크리스트)
1097
        private string _CheckList_ID { get; set; }
1098
        public string CheckList_ID
1099
        {
1100
            get
1101
            {
1102
                return _CheckList_ID;
1103
            }
1104
            set
1105
            {
1106
                _CheckList_ID = value;
1107
                OnPropertyChanged("CheckList_ID");
1108
            }
1109
        }
1110
        //강인구 추가(캡쳐 모드)
1111
        private double _Capture_Opacity { get; set; }
1112
        public double Capture_Opacity
1113
        {
1114
            get
1115
            {
1116
                return _Capture_Opacity;
1117
            }
1118
            set
1119
            {
1120
                _Capture_Opacity = value;
1121
                OnPropertyChanged("Capture_Opacity");
1122
            }
1123
        }
1124

    
1125
        private Visibility _ViewVisible { get; set; }
1126
        public Visibility ViewVisible
1127
        {
1128
            get
1129
            {
1130
                return _ViewVisible;
1131
            }
1132
            set
1133
            {
1134
                _ViewVisible = value;
1135
                OnPropertyChanged("ViewVisible");
1136
            }
1137
        }
1138

    
1139
        private bool _IsSync { get; set; }
1140
        public bool IsSync
1141
        {
1142
            get
1143
            {
1144
                return _IsSync;
1145
            }
1146
            set
1147
            {
1148
                _IsSync = value;
1149
                OnPropertyChanged("IsSync");
1150
            }
1151
        }
1152

    
1153
        private System.Windows.Media.Imaging.BitmapFrame _ImageViewPath;
1154
        public System.Windows.Media.Imaging.BitmapFrame ImageViewPath
1155
        {
1156
            get
1157
            {
1158
                return _ImageViewPath;
1159
            }
1160
            set
1161
            {
1162
                _ImageViewPath = value;
1163
                OnPropertyChanged("ImageViewPath");
1164
            }
1165
        }
1166
        private double _ImageViewWidth { get; set; }
1167
        public double ImageViewWidth
1168
        {
1169
            get
1170
            {
1171
                return _ImageViewWidth;
1172
            }
1173
            set
1174
            {
1175
                _ImageViewWidth = value;
1176
                OnPropertyChanged("ImageViewWidth");
1177
            }
1178
        }
1179
        private double _ImageViewHeight { get; set; }
1180
        public double ImageViewHeight
1181
        {
1182
            get
1183
            {
1184
                return _ImageViewHeight;
1185
            }
1186
            set
1187
            {
1188
                _ImageViewHeight = value;
1189
                OnPropertyChanged("ImageViewHeight");
1190
            }
1191
        }
1192

    
1193
        private System.Windows.Media.Imaging.BitmapImage _ImageViewPath_C;
1194
        public System.Windows.Media.Imaging.BitmapImage ImageViewPath_C
1195
        {
1196
            get
1197
            {
1198
                return _ImageViewPath_C;
1199
            }
1200
            set
1201
            {
1202
                _ImageViewPath_C = value;
1203
                OnPropertyChanged("ImageViewPath_C");
1204
            }
1205
        }
1206
        private double _ImageViewWidth_C { get; set; }
1207
        public double ImageViewWidth_C
1208
        {
1209
            get
1210
            {
1211
                return _ImageViewWidth_C;
1212
            }
1213
            set
1214
            {
1215
                _ImageViewWidth_C = value;
1216
                OnPropertyChanged("ImageViewWidth_C");
1217
            }
1218
        }
1219
        private double _ImageViewHeight_C { get; set; }
1220
        public double ImageViewHeight_C
1221
        {
1222
            get
1223
            {
1224
                return _ImageViewHeight_C;
1225
            }
1226
            set
1227
            {
1228
                _ImageViewHeight_C = value;
1229
                OnPropertyChanged("ImageViewHeight_C");
1230
            }
1231
        }
1232

    
1233

    
1234
        #endregion Property Member
1235

    
1236
        public System.IO.Stream GetStreamFromUrl(string url)
1237
        {
1238
            byte[] imageData = null;
1239

    
1240
            using (var wc = new System.Net.WebClient())
1241
                imageData = wc.DownloadData(url);
1242

    
1243
            return new System.IO.MemoryStream(imageData);
1244
        }
1245

    
1246
        public ViewerDataModel()
1247
        {
1248
            //rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue));
1249
            //rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green));
1250
            //rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple));
1251
            //rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red));
1252

    
1253
            //RectangleControl rect1 = new RectangleControl();
1254
            //rect1.StartPoint = new Point(50, 50);
1255
            //rect1.LeftBottomPoint = new Point(100, 50);
1256
            //rect1.TopRightPoint = new Point(50, 100);
1257
            //rect1.EndPoint = new Point(100, 100);
1258
            //rect1.FillColor = new SolidColorBrush(Colors.Red);
1259
            //rectangles.Add(rect1);
1260
            //
1261
            // Populate the data model with some example data.
1262
            //
1263
            //rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue));
1264
            //rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green));
1265
            //rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple));
1266
            //rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red));
1267

    
1268
            this.ControlOpacity = 1;
1269

    
1270
            /* Default
1271
             LineSize = 3, TextSize = 30, Interval = 10, ArcLength = 10, SaveInterval = 5
1272
            */            
1273
            this.LineSize = KCOM.Properties.Settings.Default.LineSize;
1274

    
1275
            this.TextSize = KCOM.Properties.Settings.Default.TextSize;
1276

    
1277
            this.Interval = KCOM.Properties.Settings.Default.Interval;
1278

    
1279
            this.ArcLength = KCOM.Properties.Settings.Default.ArcLength;
1280

    
1281
            this.DashSize = new DoubleCollection();
1282

    
1283
            this.SaveInterval = KCOM.Properties.Settings.Default.SaveInterval;
1284
            this.AngleVisibility = Visibility.Collapsed;
1285
        }
1286

    
1287

    
1288
        public List<IKCOM.MarkupInfoItem> SelectedmarkupInfoItems { get; set; }
1289
       
1290
        #region INotifyPropertyChanged Event
1291

    
1292
        private void OnPropertyChanged(string name)
1293
        {
1294
            if (PropertyChanged != null)
1295
            {
1296
                PropertyChanged(this, new PropertyChangedEventArgs(name));
1297
            }
1298
        }
1299

    
1300
        public event PropertyChangedEventHandler PropertyChanged;
1301

    
1302
        #endregion
1303
    }
1304
}
클립보드 이미지 추가 (최대 크기: 500 MB)