프로젝트

일반

사용자정보

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

markus / KCOM / Common / ViewerDataModel.cs @ 24c5e56c

이력 | 보기 | 이력해설 | 다운로드 (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 => isAdmin;
165
            set
166
            {
167
                isAdmin = value;
168
                OnPropertyChanged("IsAdmin");
169
            }
170
        }
171

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

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

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

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

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

    
235
                return _MarkupList_MY;
236
            }
237
            set
238
            {
239

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

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

    
255
                return _MarkupList_USER;
256
            }
257
            set
258
            {
259

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

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

    
275
                return _MarkupList_Pre;
276
            }
277
            set
278
            {
279

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

    
284
        }
285

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

    
300

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

    
318

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

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

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

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

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

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

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

    
437

    
438

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

    
453

    
454

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

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

    
480
        ////////////////////////////////////////////////
481

    
482

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

    
497
        }
498

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

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

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

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

    
554
        #endregion
555

    
556
        public event EventHandler<EventArgs> PageLoaded;
557

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

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

    
574

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

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

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

    
614
        }
615

    
616
        #region 버튼 여부
617

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1025
        public MainWindow SystemMain { get; set; }
1026

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

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

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

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

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

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

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

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

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

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

    
1232

    
1233
        #endregion Property Member
1234

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

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

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

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

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

    
1267
            this.ControlOpacity = 1;
1268

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

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

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

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

    
1280
            this.DashSize = new DoubleCollection();
1281

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

    
1286

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

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

    
1299
        public event PropertyChangedEventHandler PropertyChanged;
1300

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