프로젝트

일반

사용자정보

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

markus / KCOM / Common / ViewerDataModel.cs @ d952e1d5

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

1 b643fcca taeseongkim
using KCOM.Events;
2
using KCOM.Messenger;
3 992a98b4 KangIngu
using KCOMDataModel.DataModel;
4 787a4489 KangIngu
//using Leadtools;
5
using MarkupToPDF.Common;
6 6707a5c7 ljiyeon
using Newtonsoft.Json;
7 787a4489 KangIngu
using System;
8 6707a5c7 ljiyeon
using System.Collections;
9 787a4489 KangIngu
using System.Collections.Generic;
10
using System.Collections.ObjectModel;
11
using System.ComponentModel;
12 6707a5c7 ljiyeon
using System.IO;
13 787a4489 KangIngu
using System.Linq;
14
using System.Text;
15 6af42ff0 taeseongkim
using System.Threading.Tasks;
16 787a4489 KangIngu
using System.Windows;
17
using System.Windows.Controls;
18
using System.Windows.Ink;
19
using System.Windows.Media;
20 6707a5c7 ljiyeon
using System.Xml;
21
using System.Xml.Serialization;
22 787a4489 KangIngu
//using IKCOM;
23
24
namespace KCOM.Common
25
{
26
    public class ViewerDataModel : INotifyPropertyChanged
27
    {
28 24c5e56c taeseongkim
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 787a4489 KangIngu
        #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 6707a5c7 ljiyeon
        
82 787a4489 KangIngu
        //public  UndoDataList { get; set; }
83
84
85
        private ObservableCollection<IKCOM.MarkupInfoItem> markupInfoList = new ObservableCollection<IKCOM.MarkupInfoItem>();
86 8e5a4a6a taeseongkim
        private ObservableCollection<MarkupUserInfo> markupUserList = new ObservableCollection<MarkupUserInfo>();
87
        
88 787a4489 KangIngu
        private ObservableCollection<IKCOM.MarkupInfoItem> markupInfoRevList = new ObservableCollection<IKCOM.MarkupInfoItem>();
89
90 992a98b4 KangIngu
        public List<FAVORITE_DOC> FavoriteSelctedSet = new List<FAVORITE_DOC>();
91
        public List<FAVORITE_DOC> FavoriteSet = new List<FAVORITE_DOC>();
92 2b19f5f2 djkim
        public List<KCOMDataModel.DataModel.DOCPAGE> RotationDocs = new List<KCOMDataModel.DataModel.DOCPAGE>();
93 787a4489 KangIngu
        //_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 9cd2865b KangIngu
        private double Sync_contentScale = 1;
107
108
        private double Sync_contentOffsetY = 0;
109
110
        private double Sync_contentOffsetX = 0;
111
112 787a4489 KangIngu
        private double contentViewportHeight = 0;
113
114
        private double contentViewportWidth = 0;
115
116
        private double contentWidth = 0;
117
118
        private MessageCollection _k_talkMessageSet;
119 2b19f5f2 djkim
120 787a4489 KangIngu
        private double contentHeight = 0;
121
122 4f017ed3 taeseongkim
        private double markupAngle = 0;
123
124
        private double pageAngle = 0;
125 787a4489 KangIngu
126
        private double angleOffsetX = 0;
127
128
        private double angleOffsetY = 0;
129 2b19f5f2 djkim
130 787a4489 KangIngu
        private ImageBrush backgroundImage;
131
132
        //private RasterImage _rasterimage;
133
134
135
        #endregion Data Members
136
137
        #region Property Member
138
139 a1142a6b taeseongkim
        public bool IsWheelPageChanage = false;
140
141 787a4489 KangIngu
        public static ViewerDataModel Instance
142
        {
143
            get
144
            {
145
                return instance;
146
            }
147
        }
148
149 5ba8f2d5 taeseongkim
        private  bool isMarkupUpdate;
150
151 6af42ff0 taeseongkim
        private bool isDownloadOriginal;
152
        public bool IsDownloadOriginal
153
        {
154
            get => isDownloadOriginal;
155
            set
156
            {
157
                if (isDownloadOriginal != value)
158
                {
159
                    isDownloadOriginal = value;
160
                    OnPropertyChanged("IsDownloadOriginal");
161
                }
162
            }
163
        }
164
165 5a65e058 taeseongkim
        private bool isAdmin;
166
        public bool IsAdmin
167
        {
168 9d5b4bc2 taeseongkim
            //get => true;
169 5a65e058 taeseongkim
            get => isAdmin;
170
            set
171
            {
172
                isAdmin = value;
173
                OnPropertyChanged("IsAdmin");
174
            }
175
        }
176 8e6884a5 taeseongkim
177
        private bool isDocumentHistory;
178
        public bool IsDocumentHistory
179
        {
180
            get => isDocumentHistory;
181
            set
182
            {
183
                isDocumentHistory = value;
184
                OnPropertyChanged("IsDocumentHistory");
185
            }
186
        }
187
188 6af42ff0 taeseongkim
        private bool isDownloadCancel;
189
        public bool IsDownloadCancel
190
        {
191
            get => isDownloadCancel;
192
            set
193
            {
194
                if (isDownloadCancel != value)
195
                {
196
                    isDownloadCancel = value;
197
                    OnPropertyChanged("IsDownloadCancel");
198
                }
199
            }
200
        }
201
202
        private int downloadFileProgress;
203
        public int DownloadFileProgress
204
        {
205
            get => downloadFileProgress;
206
            set
207
            {
208
                if (downloadFileProgress != value)
209
                {
210
                    downloadFileProgress = value;
211
                    OnPropertyChanged("DownloadFileProgress");
212
                }
213
            }
214
        }
215
216
        private string originalTempFile;
217
        public string OriginalTempFile
218
        {
219
            get => originalTempFile;
220
            set
221
            {
222
                if (originalTempFile != value)
223
                {
224
                    originalTempFile = value;
225
                    OnPropertyChanged("OriginalTempFile");
226
                }
227
            }
228
        }
229
230 787a4489 KangIngu
        private List<IKCOM.MarkupItemEx> _MarkupList_MY { get; set; }
231
        public List<IKCOM.MarkupItemEx> MarkupList_MY
232
        {
233
            get
234
            {
235
                if (_MarkupList_MY == null)
236
                {
237
                    _MarkupList_MY = new List<IKCOM.MarkupItemEx>();
238
                }
239
240
                return _MarkupList_MY;
241
            }
242
            set
243
            {
244
245
                _MarkupList_MY = value;
246
                OnPropertyChanged("MarkupList_MY");
247
            }
248
        }
249
250
        private List<IKCOM.MarkupItemEx> _MarkupList_USER { get; set; }
251 d62c0439 humkyung
        public List<IKCOM.MarkupItemEx> MyMarkupList
252 787a4489 KangIngu
        {
253
            get
254
            {
255
                if (_MarkupList_USER == null)
256
                {
257
                    _MarkupList_USER = new List<IKCOM.MarkupItemEx>();
258
                }
259
260
                return _MarkupList_USER;
261
            }
262
            set
263
            {
264
265
                _MarkupList_USER = value;
266
                OnPropertyChanged("_MarkupList_USER");
267
            }
268
        }
269
270
        private List<IKCOM.MarkupItemEx> _MarkupList_Pre { get; set; }
271
        public List<IKCOM.MarkupItemEx> MarkupList_Pre
272
        {
273
            get
274
            {
275 2b19f5f2 djkim
                if (_MarkupList_Pre == null)
276 787a4489 KangIngu
                {
277 2b19f5f2 djkim
                    _MarkupList_Pre = new List<IKCOM.MarkupItemEx>();
278 787a4489 KangIngu
                }
279
280
                return _MarkupList_Pre;
281
            }
282
            set
283
            {
284 2b19f5f2 djkim
285
                _MarkupList_Pre = value;
286 787a4489 KangIngu
                OnPropertyChanged("MarkupList_Pre");
287
            }
288
289
        }
290
291 992a98b4 KangIngu
        private System.IO.FileInfo _searchPDF { get; set; }
292
        public System.IO.FileInfo searchPDF
293
        {
294
            get
295
            {
296
                return _searchPDF;
297
            }
298
            set
299
            {
300
                _searchPDF = value;
301
                OnPropertyChanged("searchPDF");
302
            }
303
        }
304
305 787a4489 KangIngu
306
        /// <summary>
307
        /// 현재 상단 메뉴에서 선택된 컨트롤
308
        /// </summary>
309
        private string _SelectedControl { get; set; }
310
        public string SelectedControl
311
        {
312
            get
313
            {
314
                return _SelectedControl;
315
            }
316
            set
317
            {
318
                _SelectedControl = value;
319
                OnPropertyChanged("SelectedControl");
320
            }
321
        }
322
323 b74a9c91 taeseongkim
        private List<KCOM.Common.MacroItem> _MacroItems;
324
325
        public List<KCOM.Common.MacroItem> MacroItems
326
        {
327
            get
328
            {
329
                return _MacroItems;
330
            }
331
332
            set
333
            {
334
                _MacroItems = value;
335
            }
336
        }
337
338
        private int _MacroCommandIndex;
339
340
        public int MacroCommandIndex
341
        {
342
            get
343
            {
344
                return _MacroCommandIndex;
345
            }
346
347
            set
348
            {
349
                _MacroCommandIndex = value;
350
            }
351
        }
352
353
        private bool _IsMacroCommand;
354
355
        public bool IsMacroCommand
356
        {
357
            get
358
            {
359
                return _IsMacroCommand;
360
            }
361
362
            set
363
            {
364
                _IsMacroCommand = value;
365
            }
366
        }
367 787a4489 KangIngu
368
        /// <summary>
369
        /// 현재 상단 메뉴의 선 굵기값
370
        /// </summary>
371
        private double _LineSize { get; set; }
372
        public double LineSize
373
        {
374
            get
375
            {
376
                return _LineSize;
377
            }
378
            set
379
            {
380
                _LineSize = value;
381
                OnPropertyChanged("LineSize");
382
            }
383
        }
384
385 5ce56a3a KangIngu
        private double _Interval { get; set; }
386
        public double Interval
387
        {
388
            get
389
            {
390
                return _Interval;
391
            }
392
            set
393
            {
394
                _Interval = value;
395
                OnPropertyChanged("Interval");
396
            }
397
        }
398 537f4cd8 djkim
        private double _SaveInterval { get; set; }
399
        public double SaveInterval
400
        {
401
            get
402
            {
403
                return _SaveInterval;
404
            }
405
            set
406
            {
407
                _SaveInterval = value;
408
                OnPropertyChanged("SaveInterval");
409
            }
410
        }
411 9f473fb7 KangIngu
        private double _ArcLength { get; set; }
412
        public double ArcLength
413
        {
414
            get
415
            {
416
                return _ArcLength;
417
            }
418
            set
419
            {
420
                _ArcLength = value;
421
                OnPropertyChanged("ArcLength");
422
            }
423
        }
424
425 787a4489 KangIngu
        public bool IsPressShift
426
        {
427
            get
428
            {
429 e36af3a8 humkyung
                return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Shift) == System.Windows.Input.ModifierKeys.Shift);
430 787a4489 KangIngu
            }
431
        }
432
433
        public bool IsPressCtrl
434
        {
435
            get
436
            {
437 e36af3a8 humkyung
                return ((System.Windows.Input.Keyboard.Modifiers & System.Windows.Input.ModifierKeys.Control) == System.Windows.Input.ModifierKeys.Control);
438 787a4489 KangIngu
            }
439
        }
440
441
        /// <summary>
442
        /// Dash 사이즈 
443
        /// </summary>
444
        private DoubleCollection _DashSize { get; set; }
445
        public DoubleCollection DashSize
446
        {
447
            get
448
            {
449
                return _DashSize;
450
            }
451
            set
452
            {
453
                _DashSize = value;
454
                OnPropertyChanged("DashSize");
455
            }
456
        }
457
458
        private string _ControlTag { get; set; }
459
        public string ControlTag
460
        {
461
            get
462
            {
463
                return _ControlTag;
464
            }
465
            set
466
            {
467
                _ControlTag = value;
468
                OnPropertyChanged("ControlTag");
469
            }
470
        }
471
472 69ef0800 KangIngu
        private string _CheckStatus { get; set; }
473
        public string CheckStatus
474
        {
475
            get
476
            {
477
                return _CheckStatus;
478
            }
479
            set
480
            {
481
                _CheckStatus = value;
482
                OnPropertyChanged("CheckStatus");
483
            }
484
        }
485
486
487
488 787a4489 KangIngu
        //private bool _IsPageChanged { get; set; }
489
        //public bool IsPageChanged
490
        //{
491
        //    get
492
        //    {
493
        //        return _IsPageChanged;
494
        //    }
495
        //    set
496
        //    {
497
        //        _IsPageChanged = value;
498
        //        OnPropertyChanged("IsPageChanged");
499
        //    }
500
        //}
501
502
503
504
        ///// <summary>
505
        ///// 강인구 추가(Check List관련)
506
        ///// </summary>
507
        //public List<Check_Inferface> Check_Item
508
        //{
509
        //    get
510
        //    {
511
        //        return check_Item;
512
        //    }
513
        //}
514
515
        private bool _IsConsolidate { get; set; }
516
        public bool IsConsolidate
517
        {
518
            get
519
            {
520
                return _IsConsolidate;
521
            }
522
            set
523
            {
524
                _IsConsolidate = value;
525
                OnPropertyChanged("IsConsolidate");
526
            }
527
        }
528
529 bae83c92 taeseongkim
        private bool _IsFinalPDF { get; set; }
530
        public bool IsFinalPDF
531
        {
532
            get
533
            {
534
                return _IsFinalPDF;
535
            }
536
            set
537
            {
538
                _IsFinalPDF = value;
539
                OnPropertyChanged("IsFinalPDF");
540
            }
541
        }
542
        private DateTime _FinalPDFTime { get; set; }
543
        public DateTime FinalPDFTime
544
        {
545
            get
546
            {
547
                return _FinalPDFTime;
548
            }
549
            set
550
            {
551
                _FinalPDFTime = value;
552
                OnPropertyChanged("FinalPDFTime");
553
            }
554
        }
555
556 787a4489 KangIngu
        ////////////////////////////////////////////////
557
558
559
        #region Angle 관련
560 4f017ed3 taeseongkim
        private Visibility _MarkupAngleVisibility { get; set; }
561
        public Visibility MarkupAngleVisibility
562 787a4489 KangIngu
        {
563
            get
564
            {
565 4f017ed3 taeseongkim
                return _MarkupAngleVisibility;
566 787a4489 KangIngu
            }
567
            set
568
            {
569 4f017ed3 taeseongkim
                _MarkupAngleVisibility = value;
570
                OnPropertyChanged("MarkupAngleVisibility");
571 787a4489 KangIngu
            }
572
573
        }
574
575 4f017ed3 taeseongkim
        public double MarkupAngle
576
        {
577
            get
578
            {
579
                return markupAngle;
580
            }
581
            set
582
            {
583
                markupAngle = value;
584
                OnPropertyChanged("MarkupAngle");
585
            }
586
        }
587
588
        public double PageAngle
589 168f8027 taeseongkim
        {
590
            get
591
            {
592 4f017ed3 taeseongkim
                return pageAngle;
593 168f8027 taeseongkim
            }
594
            set
595
            {
596 4f017ed3 taeseongkim
                pageAngle = value;
597
                OnPropertyChanged("PageAngle");
598 168f8027 taeseongkim
            }
599
        }
600
601 787a4489 KangIngu
        private string _HelperContent { get; set; }
602
        public string HelperContent
603
        {
604
            get
605
            {
606
                return _HelperContent;
607
            }
608
            set
609
            {
610
                _HelperContent = value;
611
                OnPropertyChanged("HelperContent");
612
            }
613
        }
614
615
        private string _HelperHeader { get; set; }
616
        public string HelperHeader
617
        {
618
            get
619
            {
620
                return _HelperHeader;
621
            }
622
            set
623
            {
624
                _HelperHeader = value;
625
                OnPropertyChanged("HelperHeader");
626
            }
627
        }
628
629
        private bool _HelperExit { get; set; }
630
        public bool HelperExit
631
        {
632
            get
633
            {
634
                return _HelperExit;
635
            }
636
            set
637
            {
638
                _HelperExit = value;
639
                OnPropertyChanged("HelperExit");
640
            }
641
        }
642
643
        #endregion
644
645 eeb0a39c taeseongkim
        public event EventHandler<EventArgs> PageLoaded;
646 f65e6c02 taeseongkim
647
        /// <summary>
648
        /// 페이지 변경 후 페이지에 해당하는 마크업을 모두 읽었을때 이벤트를 보내도록 한다.
649
        /// </summary>
650 d5096d58 taeseongkim
        public void LoadPageMarkupFinish(Rect rect)
651 f65e6c02 taeseongkim
        {
652 eeb0a39c taeseongkim
            if(PageLoaded != null)
653 f65e6c02 taeseongkim
            {
654 eeb0a39c taeseongkim
                PageLoaded(this, new EventArgs());
655 f65e6c02 taeseongkim
            }
656 d5096d58 taeseongkim
            else
657
            {
658
                this.SystemMain.dzMainMenu.zoomAndPanControl.ZoomTo(rect);
659
            }
660 f65e6c02 taeseongkim
        }
661
662 bae83c92 taeseongkim
        public bool SaveCheck()
663
        {
664
            bool result = false;
665
666
            if (ViewerDataModel.Instance.UndoDataList.Count > 0)
667
            {
668
                DateTime undoTime = UndoDataList.OrderByDescending(order => order.EventTime).FirstOrDefault().EventTime;
669
                DateTime updatetime = DateTime.Now.AddDays(-1);
670
                
671
                if (_markupInfoList.Count > 0)
672
                {
673
                    updatetime = _markupInfoList.OrderByDescending(order => order.UpdateTime).FirstOrDefault().UpdateTime;
674
                }
675
676
                if (undoTime > updatetime)
677
                {
678
                    result = false;
679
                }
680
                else
681
                {
682
                    result = true;
683
                }
684
            }
685
            else
686
            {
687
                result = true;
688
            }
689
690
            return result;
691
        }
692
693
        public bool FinalPDFCheck()
694
        {
695
            bool result = false;
696
697
            DateTime updatetime = DateTime.Now.AddDays(-1);
698
699
            if (_markupInfoList.Count > 0)
700
            {
701
               var consolidateItems = _markupInfoList.Where(x => x.Consolidate == 1 && x.AvoidConsolidate == 0);
702
703
                if (consolidateItems.Count() > 0)
704
                {
705
                    updatetime = consolidateItems.OrderByDescending(order => order.UpdateTime).FirstOrDefault().UpdateTime;
706
                }
707
            }
708
709
            if (FinalPDFTime > updatetime)
710
            {
711
                result = true;
712
            }
713
714
            return result;
715
        }
716
717 b643fcca taeseongkim
        public void SetAngleVisible(Visibility visibility)
718
        {
719 4f017ed3 taeseongkim
            this.MarkupAngleVisibility = visibility;
720 b643fcca taeseongkim
        }
721
722 f65e6c02 taeseongkim
723 787a4489 KangIngu
        public ObservableCollection<CommentUserInfo> MarkupControls
724
        {
725
            get
726
            {
727
                return markupControls;
728
            }
729
        }
730
731
        public ObservableCollection<CommentUserInfo> MarkupControls_Sync
732
        {
733
            get
734
            {
735
                return markupControls_Sync;
736
            }
737
        }
738 6707a5c7 ljiyeon
        public int current_page_commentcnt = 0;
739 787a4489 KangIngu
        public ObservableCollection<CommentUserInfo> MarkupControls_USER
740
        {
741
            get
742
            {
743
                return markupControls_User;
744
            }
745
        }
746
747
        public ObservableCollection<Undo_data> UndoDataList
748
        {
749
            get
750
            {
751
                return undoDataList;
752
            }
753
        }
754 6707a5c7 ljiyeon
        
755 787a4489 KangIngu
        public StrokeCollection MarkupPens
756
        {
757
            get
758
            {
759
                return markupPens;
760
            }
761
762
        }
763
764
        #region 버튼 여부
765
766
        /// <summary>
767
        /// 상단 Fill 버튼이 클릭 되어있는지
768
        /// </summary>
769
        private bool _checkFillShape { get; set; }
770
        public bool checkFillShape
771
        {
772
            get
773
            {
774
                return _checkFillShape;
775
            }
776
            set
777
            {
778
                _checkFillShape = value;
779
                OnPropertyChanged("checkFillShape");
780
            }
781
        }
782
783
        /// <summary>
784
        /// 상단 Hatch 버튼이 클릭 되어있는지
785
        /// </summary>
786
        private bool _checkHatchShape { get; set; }
787
        public bool checkHatchShape
788
        {
789
            get
790
            {
791
                return _checkHatchShape;
792
            }
793
            set
794
            {
795
                _checkHatchShape = value;
796
                OnPropertyChanged("checkHatchShape");
797
            }
798
        }
799
800
        private double _controlOpacity { get; set; }
801
        public double ControlOpacity
802
        {
803
            get
804
            {
805
                return _controlOpacity;
806
            }
807
            set
808
            {
809 2b19f5f2 djkim
810
                _controlOpacity = value;
811 787a4489 KangIngu
                OnPropertyChanged("ControlOpacity");
812
            }
813
        }
814
815
        private MarkupToPDF.Controls.Common.PaintSet _paintSet { get; set; }
816
        public MarkupToPDF.Controls.Common.PaintSet paintSet
817
        {
818
            get
819
            {
820
                return _paintSet;
821
            }
822
            set
823
            {
824
                _paintSet = value;
825
                OnPropertyChanged("paintSet");
826
            }
827
        }
828
829
        /// <summary>
830
        /// 강인구 추가
831
        /// 상단 TextStyle 버튼이 클릭 되어있는지
832
        /// </summary>
833
        private bool _checkTextStyle { get; set; }
834
        public bool checkTextStyle
835
        {
836
            get
837
            {
838
                return _checkTextStyle;
839
            }
840
            set
841
            {
842
                _checkTextStyle = value;
843
                OnPropertyChanged("checkTextStyle");
844
            }
845
        }
846
847
        /// <summary>
848
        /// 강인구 추가
849
        /// 상단 TextWeight 버튼이 클릭 되어있는지
850
        /// </summary>
851
        private bool _checkTextWeight { get; set; }
852
        public bool checkTextWeight
853
        {
854
            get
855
            {
856
                return _checkTextWeight;
857
            }
858
            set
859
            {
860
                _checkTextWeight = value;
861
                OnPropertyChanged("checkTextWeight");
862
            }
863
        }
864
865
        /// <summary>
866
        /// 강인구 추가
867
        /// 상단 UnderLine 버튼이 클릭 되어있는지
868
        /// </summary>
869
        private bool _checkUnderLine { get; set; }
870
        public bool checkUnderLine
871
        {
872
            get
873
            {
874
                return _checkUnderLine;
875
            }
876
            set
877
            {
878
                _checkUnderLine = value;
879
                OnPropertyChanged("checkUnderLine");
880
            }
881
        }
882
883
        /// <summary>
884
        /// 상단 Hatch 버튼이 클릭 되어있는지
885
        /// </summary>
886
        private bool _checkHighShape { get; set; }
887
        public bool checkHighShape
888
        {
889
            get
890
            {
891
                return _checkHighShape;
892
            }
893
            set
894
            {
895
                _checkHighShape = value;
896
                OnPropertyChanged("checkHighShape");
897
            }
898
        }
899
900
        /// <summary>
901
        /// 상단 Axis 버튼이 클릭 되어있는지
902
        /// </summary>
903 233ef333 taeseongkim
        private bool _IsAxisLock { get; set; }
904
        public bool IsAxisLock
905 787a4489 KangIngu
        {
906
            get
907
            {
908 233ef333 taeseongkim
                return _IsAxisLock;
909 787a4489 KangIngu
            }
910
            set
911
            {
912 233ef333 taeseongkim
                _IsAxisLock = value;
913
                OnPropertyChanged("IsAxisLock");
914 787a4489 KangIngu
            }
915
        }
916 d4b0c723 KangIngu
917
        /// <summary>
918
        /// 상단 Highlight 버튼이 클릭 되어있는지
919
        /// </summary>
920
        private bool _checkHighlight { get; set; }
921
        public bool checkHighlight
922
        {
923
            get
924
            {
925
                return _checkHighlight;
926
            }
927
            set
928
            {
929
                _checkHighlight = value;
930
                OnPropertyChanged("checkHighlight");
931
            }
932
        }
933
934
        /// <summary>
935
        /// 강인구 추가
936
        /// 상단 TextWeight 버튼이 클릭 되어있는지
937
        /// </summary>
938
        private double _TextSize { get; set; }
939
        public double TextSize
940
        {
941
            get
942
            {
943
                return _TextSize;
944
            }
945
            set
946
            {
947
                _TextSize = value;
948
                OnPropertyChanged("TextSize");
949
            }
950
        }
951 787a4489 KangIngu
        #endregion
952
953
        public ImageBrush BackgroundImage
954
        {
955
            get
956
            {
957
                return backgroundImage;
958
            }
959
            set
960
            {
961
                backgroundImage = value;
962
                OnPropertyChanged("BackgroundImage");
963
            }
964
        }
965
966
        public ObservableCollection<KCOMDataModel.DataModel.DOCPAGE> Document_Info
967
        {
968
            get
969
            {
970
                return document_Info;
971
            }
972
        }
973
974
        public double ContentScale
975
        {
976
            get
977
            {
978
                return contentScale;
979
            }
980
            set
981
            {
982
                contentScale = value;
983
984
                double minOffsetX = 0.0;
985
                double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth);
986
                contentOffsetX = Math.Min(Math.Max(contentOffsetX, minOffsetX), maxOffsetX);
987
988
                double minOffsetY = 0.0;
989
                double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight);
990
                contentOffsetY = Math.Min(Math.Max(contentOffsetY, minOffsetY), maxOffsetY);
991
992
                OnPropertyChanged("ContentScale");
993
            }
994
        }
995
996 9cd2865b KangIngu
        public double Sync_ContentScale
997
        {
998
            get
999
            {
1000
                return Sync_contentScale;
1001
            }
1002
            set
1003
            {
1004
                Sync_contentScale = value;
1005
                OnPropertyChanged("Sync_ContentScale");
1006
            }
1007
        }
1008
1009 787a4489 KangIngu
        public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoList
1010
        {
1011
            get
1012
            {
1013
                return markupInfoList;
1014
            }
1015
            set
1016
            {
1017
                markupInfoList = value;
1018
                OnPropertyChanged("_markupInfoList");
1019
            }
1020
        }
1021
1022 8e5a4a6a taeseongkim
        public ObservableCollection<MarkupUserInfo> _markupUserList
1023
        {
1024
            get
1025
            {
1026
                return markupUserList;
1027
            }
1028
            set
1029
            {
1030
                markupUserList = value;
1031
                OnPropertyChanged("_markupUserList");
1032
            }
1033
        }
1034
1035 787a4489 KangIngu
        public ObservableCollection<IKCOM.MarkupInfoItem> _markupInfoRevList
1036
        {
1037
            get
1038
            {
1039
                return markupInfoRevList;
1040
            }
1041
            set
1042
            {
1043
                markupInfoRevList = value;
1044
                OnPropertyChanged("_markupInfoRevList");
1045
            }
1046
        }
1047
1048
        public double ContentOffsetX
1049
        {
1050
            get
1051
            {
1052
                return contentOffsetX;
1053
            }
1054
            set
1055
            {
1056
                double minOffsetX = 0.0;
1057
                double maxOffsetX = Math.Max(0.0, ContentWidth - ContentViewportWidth);
1058
                contentOffsetX = Math.Min(Math.Max(value, minOffsetX), maxOffsetX);
1059
                OnPropertyChanged("ContentOffsetX");
1060
            }
1061
        }
1062
1063
        public double ContentOffsetY
1064
        {
1065
            get
1066
            {
1067
                return contentOffsetY;
1068
            }
1069
            set
1070
            {
1071
                double minOffsetY = 0.0;
1072
                double maxOffsetY = Math.Max(0.0, ContentHeight - ContentViewportHeight);
1073
                contentOffsetY = Math.Min(Math.Max(value, minOffsetY), maxOffsetY);
1074
                OnPropertyChanged("ContentOffsetY");
1075
            }
1076
        }
1077
1078 9cd2865b KangIngu
        public double Sync_ContentOffsetX
1079
        {
1080
            get
1081
            {
1082
                return Sync_contentOffsetX;
1083
            }
1084
            set
1085
            {
1086
                Sync_contentOffsetX = value;
1087
                OnPropertyChanged("Sync_ContentOffsetX");
1088
            }
1089
        }
1090
1091
        public double Sync_ContentOffsetY
1092
        {
1093
            get
1094
            {
1095
                return Sync_contentOffsetY;
1096
            }
1097
            set
1098
            {
1099
                Sync_contentOffsetY = value;
1100
                OnPropertyChanged("Sync_ContentOffsetY");
1101
            }
1102
        }
1103
1104 787a4489 KangIngu
        public MessageCollection k_talkMessageSet
1105
        {
1106
            get
1107
            {
1108 2b19f5f2 djkim
                if (_k_talkMessageSet == null)
1109 787a4489 KangIngu
                {
1110
                    _k_talkMessageSet = new MessageCollection();
1111
                }
1112
                return _k_talkMessageSet;
1113
            }
1114
            set
1115
            {
1116
                _k_talkMessageSet = value;
1117
                OnPropertyChanged("k_talkMessageSet");
1118
            }
1119
        }
1120
1121
        public double ContentWidth
1122
        {
1123
            get
1124
            {
1125
                return contentWidth;
1126
            }
1127
            set
1128
            {
1129
                contentWidth = value;
1130
                OnPropertyChanged("ContentWidth");
1131
            }
1132
        }
1133
1134
        public double ContentHeight
1135
        {
1136
            get
1137
            {
1138
                return contentHeight;
1139
            }
1140
            set
1141
            {
1142
                contentHeight = value;
1143
                OnPropertyChanged("ContentHeight");
1144
            }
1145
        }
1146
1147
        public double ContentViewportWidth
1148
        {
1149
            get
1150
            {
1151
                return contentViewportWidth;
1152
            }
1153
            set
1154
            {
1155
                contentViewportWidth = value;
1156
                OnPropertyChanged("ContentViewportWidth");
1157
            }
1158
        }
1159
1160
        public double ContentViewportHeight
1161
        {
1162
            get
1163
            {
1164
                return contentViewportHeight;
1165
            }
1166
            set
1167
            {
1168
                contentViewportHeight = value;
1169
                OnPropertyChanged("ContentViewportHeight");
1170
            }
1171
        }
1172
1173
        public MainWindow SystemMain { get; set; }
1174
1175
        private bool _PageBalanceMode { get; set; }
1176
        public bool PageBalanceMode
1177
        {
1178
            get
1179
            {
1180
                return _PageBalanceMode;
1181
            }
1182
            set
1183
            {
1184
                _PageBalanceMode = value;
1185
                OnPropertyChanged("PageBalanceMode");
1186
            }
1187
        }
1188
1189
        private int _PageBalanceNumber { get; set; }
1190
        public int PageBalanceNumber
1191
        {
1192
            get
1193
            {
1194
                return _PageBalanceNumber;
1195
            }
1196
            set
1197
            {
1198
                _PageBalanceNumber = value;
1199
                OnPropertyChanged("PageBalanceNumber");
1200
            }
1201
        }
1202
1203 752b18ef taeseongkim
        
1204
        private int _SyncPageNumber { get; set; }
1205
1206
        /// <summary>
1207
        /// Sync Page No
1208
        /// </summary>
1209
        public int SyncPageNumber
1210 787a4489 KangIngu
        {
1211
            get
1212
            {
1213 752b18ef taeseongkim
                return _SyncPageNumber;
1214 787a4489 KangIngu
            }
1215
            set
1216
            {
1217 752b18ef taeseongkim
                if (_SyncPageNumber != value)
1218 e13b43de taeseongkim
                {
1219 752b18ef taeseongkim
                    _SyncPageNumber = value;
1220 e13b43de taeseongkim
                    OnPropertyChanged("PageNumber");
1221
                }
1222 787a4489 KangIngu
            }
1223
        }
1224
1225
        public double AngleOffsetX
1226
        {
1227
            get
1228
            {
1229
                return angleOffsetX;
1230
            }
1231
            set
1232
            {
1233
                angleOffsetX = value;
1234
                OnPropertyChanged("AngleOffsetX");
1235
            }
1236
        }
1237
1238
        public double AngleOffsetY
1239
        {
1240
            get
1241
            {
1242
                return angleOffsetY;
1243
            }
1244
            set
1245
            {
1246
                angleOffsetY = value;
1247
                OnPropertyChanged("AngleOffsetY");
1248
            }
1249
        }
1250
1251
        //강인구 추가(체크리스트)
1252
        private string _CheckList_ID { get; set; }
1253
        public string CheckList_ID
1254
        {
1255
            get
1256
            {
1257
                return _CheckList_ID;
1258
            }
1259
            set
1260
            {
1261
                _CheckList_ID = value;
1262
                OnPropertyChanged("CheckList_ID");
1263
            }
1264
        }
1265
        //강인구 추가(캡쳐 모드)
1266
        private double _Capture_Opacity { get; set; }
1267
        public double Capture_Opacity
1268
        {
1269
            get
1270
            {
1271
                return _Capture_Opacity;
1272
            }
1273
            set
1274
            {
1275
                _Capture_Opacity = value;
1276
                OnPropertyChanged("Capture_Opacity");
1277
            }
1278
        }
1279
1280
        private Visibility _ViewVisible { get; set; }
1281
        public Visibility ViewVisible
1282
        {
1283
            get
1284
            {
1285
                return _ViewVisible;
1286
            }
1287
            set
1288
            {
1289
                _ViewVisible = value;
1290
                OnPropertyChanged("ViewVisible");
1291
            }
1292
        }
1293
1294
        private bool _IsSync { get; set; }
1295
        public bool IsSync
1296
        {
1297
            get
1298
            {
1299
                return _IsSync;
1300
            }
1301
            set
1302
            {
1303
                _IsSync = value;
1304
                OnPropertyChanged("IsSync");
1305
            }
1306
        }
1307
1308 eeb0a39c taeseongkim
        private System.Windows.Media.Imaging.BitmapFrame _ImageViewPath;
1309
        public System.Windows.Media.Imaging.BitmapFrame ImageViewPath
1310 787a4489 KangIngu
        {
1311
            get
1312
            {
1313
                return _ImageViewPath;
1314
            }
1315
            set
1316
            {
1317
                _ImageViewPath = value;
1318
                OnPropertyChanged("ImageViewPath");
1319
            }
1320
        }
1321
        private double _ImageViewWidth { get; set; }
1322
        public double ImageViewWidth
1323
        {
1324
            get
1325
            {
1326
                return _ImageViewWidth;
1327
            }
1328
            set
1329
            {
1330
                _ImageViewWidth = value;
1331
                OnPropertyChanged("ImageViewWidth");
1332
            }
1333
        }
1334
        private double _ImageViewHeight { get; set; }
1335
        public double ImageViewHeight
1336
        {
1337
            get
1338
            {
1339
                return _ImageViewHeight;
1340
            }
1341
            set
1342
            {
1343
                _ImageViewHeight = value;
1344
                OnPropertyChanged("ImageViewHeight");
1345
            }
1346
        }
1347
1348 eeb0a39c taeseongkim
        private System.Windows.Media.Imaging.BitmapImage _ImageViewPath_C;
1349 787a4489 KangIngu
        public System.Windows.Media.Imaging.BitmapImage ImageViewPath_C
1350
        {
1351
            get
1352
            {
1353
                return _ImageViewPath_C;
1354
            }
1355
            set
1356
            {
1357
                _ImageViewPath_C = value;
1358
                OnPropertyChanged("ImageViewPath_C");
1359
            }
1360
        }
1361
        private double _ImageViewWidth_C { get; set; }
1362
        public double ImageViewWidth_C
1363
        {
1364
            get
1365
            {
1366
                return _ImageViewWidth_C;
1367
            }
1368
            set
1369
            {
1370
                _ImageViewWidth_C = value;
1371
                OnPropertyChanged("ImageViewWidth_C");
1372
            }
1373
        }
1374
        private double _ImageViewHeight_C { get; set; }
1375
        public double ImageViewHeight_C
1376
        {
1377
            get
1378
            {
1379
                return _ImageViewHeight_C;
1380
            }
1381
            set
1382
            {
1383
                _ImageViewHeight_C = value;
1384
                OnPropertyChanged("ImageViewHeight_C");
1385
            }
1386
        }
1387
1388
1389
        #endregion Property Member
1390
1391
        public System.IO.Stream GetStreamFromUrl(string url)
1392
        {
1393
            byte[] imageData = null;
1394
1395
            using (var wc = new System.Net.WebClient())
1396
                imageData = wc.DownloadData(url);
1397
1398
            return new System.IO.MemoryStream(imageData);
1399
        }
1400
1401
        public ViewerDataModel()
1402
        {
1403
            //rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue));
1404
            //rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green));
1405
            //rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple));
1406
            //rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red));
1407
1408
            //RectangleControl rect1 = new RectangleControl();
1409
            //rect1.StartPoint = new Point(50, 50);
1410
            //rect1.LeftBottomPoint = new Point(100, 50);
1411
            //rect1.TopRightPoint = new Point(50, 100);
1412
            //rect1.EndPoint = new Point(100, 100);
1413
            //rect1.FillColor = new SolidColorBrush(Colors.Red);
1414
            //rectangles.Add(rect1);
1415
            //
1416
            // Populate the data model with some example data.
1417
            //
1418
            //rectangles.Add(new RectangleData(50, 50, 80, 150, Colors.Blue));
1419
            //rectangles.Add(new RectangleData(550, 350, 80, 150, Colors.Green));
1420
            //rectangles.Add(new RectangleData(850, 850, 30, 20, Colors.Purple));
1421
            //rectangles.Add(new RectangleData(1850, 1850, 80, 150, Colors.Red));
1422
1423
            this.ControlOpacity = 1;
1424 2b19f5f2 djkim
1425 5822e146 ljiyeon
            /* Default
1426
             LineSize = 3, TextSize = 30, Interval = 10, ArcLength = 10, SaveInterval = 5
1427
            */            
1428
            this.LineSize = KCOM.Properties.Settings.Default.LineSize;
1429 787a4489 KangIngu
1430 5822e146 ljiyeon
            this.TextSize = KCOM.Properties.Settings.Default.TextSize;
1431 d4b0c723 KangIngu
1432 5822e146 ljiyeon
            this.Interval = KCOM.Properties.Settings.Default.Interval;
1433 5ce56a3a KangIngu
1434 5822e146 ljiyeon
            this.ArcLength = KCOM.Properties.Settings.Default.ArcLength;
1435 9f473fb7 KangIngu
1436 89b30429 djkim
            this.DashSize = new DoubleCollection();
1437 537f4cd8 djkim
1438 5822e146 ljiyeon
            this.SaveInterval = KCOM.Properties.Settings.Default.SaveInterval;
1439 4f017ed3 taeseongkim
            this.MarkupAngleVisibility = Visibility.Collapsed;
1440 6707a5c7 ljiyeon
        }
1441 f714bef8 djkim
1442 6af42ff0 taeseongkim
1443
        public List<IKCOM.MarkupInfoItem> SelectedmarkupInfoItems { get; set; }
1444 5ba8f2d5 taeseongkim
        public bool IsMarkupUpdate { get => isMarkupUpdate; set => isMarkupUpdate = value; }
1445
1446 787a4489 KangIngu
        #region INotifyPropertyChanged Event
1447
1448
        private void OnPropertyChanged(string name)
1449
        {
1450
            if (PropertyChanged != null)
1451
            {
1452
                PropertyChanged(this, new PropertyChangedEventArgs(name));
1453
            }
1454
        }
1455
1456
        public event PropertyChangedEventHandler PropertyChanged;
1457
1458
        #endregion
1459
    }
1460
}
클립보드 이미지 추가 (최대 크기: 500 MB)