프로젝트

일반

사용자정보

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

markus / KCOM / Common / ViewerDataModel.cs @ a9a82876

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