프로젝트

일반

사용자정보

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

markus / ConvertService / ServiceBase / Markus.Service.StationController / ViewModel / DataBaseItemsModel.cs @ 93f5e32a

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

1
using Markus.Service.Extensions;
2
using Markus.Service.StationController.Data;
3
using Markus.Service.StationController.Behaviors;
4
using Markus.Service.StationController.Extensions;
5
using Markus.Service.StationController.Controls;
6
using Microsoft.Win32;
7
using System;
8
using System.Collections.Generic;
9
using System.ComponentModel;
10
using System.Linq;
11
using System.Threading.Tasks;
12
using System.Web;
13
using System.Windows;
14
using Telerik.Windows.Controls;
15
using Telerik.Windows.Data;
16
using System.Net;
17
using System.Windows.Threading;
18
using System.Diagnostics;
19
using System.Windows.Input;
20
using Markus.Mvvm.ToolKit;
21
using System.Windows.Data;
22
using System.Windows.Controls;
23
using System.IO;
24
using Newtonsoft.Json;
25
//using Markus.Service.Interface;
26
using static Markus.Service.StationController.Data.ConvertPDF;
27
using System.Collections.ObjectModel;
28

    
29
namespace Markus.Service.StationController.ViewModel
30
{
31
    //세미
32
    public class DataBaseItemsModel : Mvvm.ToolKit.ViewModelBase
33
    {
34
        #region Constructor
35

    
36
        /// <summary>
37
        /// 실행하면 처음 들어가는 부분
38
        /// </summary>
39
        public DataBaseItemsModel()
40
        {
41
            DataFilterCommand = new DelegateCommand(DataFilter);
42
            DataSaveFileGemBoxCommand = new DelegateCommand(DataExportData);
43
            ConvertCommand = new DelegateCommand(DataConvert);
44
            DeleteCommand = new DelegateCommand(DataDelete);
45
            ValidateCommand = new DelegateCommand(DataValidate);
46
            MarkusLinkCommand = new DelegateCommand(MarkusLink);
47
            RemoveCreateTimeFilterCommand = new DelegateCommand(RemoveCreateTimeFilter);
48
            ResetCommand = new DelegateCommand(Reset);
49
            ConvertAddCommand = new DelegateCommand(ConvertAdd);
50
            ConvertPathFileSearchCommand = new DelegateCommand(ConvertPathFileSearch);
51
        }
52

    
53
        #endregion
54

    
55
        #region Properties
56

    
57
        DataService.DataServiceClient WcfClient = new DataService.DataServiceClient();
58

    
59
        public ObservableCollection<ProjectName> _ProjectNames;
60
        public ObservableCollection<ProjectName> ProjectNames
61
        {
62
            get
63
            {
64
                if (_ProjectNames == null)
65
                {
66
                    _ProjectNames = new System.Collections.ObjectModel.ObservableCollection<ProjectName>();
67
                }
68

    
69
                return _ProjectNames;
70
            }
71
            set
72
            {
73
                _ProjectNames = value;
74
                OnPropertyChanged(() => ProjectNames);
75
            }
76
        }
77

    
78
        private bool _ExcptionCheck = false;
79
        public bool ExcptionCheck
80
        {
81
            get
82
            {
83
                return _ExcptionCheck;
84
            }
85
            set
86
            {
87
                _ExcptionCheck = value;
88
                OnPropertyChanged(() => ExcptionCheck);
89
            }
90
        }
91

    
92
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _FilterSearch;
93
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> FilterSearch
94
        {
95
            get
96
            {
97
                if (_FilterSearch == null)
98
                {
99
                    _FilterSearch = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>
100
                    {
101
                        new ConvertPDF{ProjectNumber = "Filter Search"}
102
                    };
103
                }
104

    
105
                return _FilterSearch;
106
            }
107
        }
108

    
109
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _AliveItems;
110
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> AliveItems
111
        {
112
            get => _AliveItems;
113
            set
114
            {
115
                _AliveItems = value;
116
                OnPropertyChanged(() => AliveItems);
117
            }
118
        }
119

    
120
        public ICollectionView FilterConvertSourceView
121
        {
122
            get
123
            {
124
                var view = CollectionViewSource.GetDefaultView(FilterConvertSource);
125
                return view;
126
            }
127
        }
128

    
129
        private static System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _ConvertSource;
130
        public static System.Collections.ObjectModel.ObservableCollection<ConvertPDF> ConvertSource
131
        {
132
            get
133
            {
134
                if (_ConvertSource == null)
135
                {
136
                    _ConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
137
                }
138
                return _ConvertSource;
139
            }
140
            set
141
            {
142
                _ConvertSource = value;
143
            }
144
        }
145

    
146
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _FilterConvertSource;
147
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> FilterConvertSource
148
        {
149
            get
150
            {
151
                if (_FilterConvertSource == null)
152
                {
153
                    _FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
154
                }
155
                return _FilterConvertSource;
156
            }
157
            set
158
            {
159
                _FilterConvertSource = value;
160
               OnPropertyChanged(() => FilterConvertSource);
161
            }
162
        }
163

    
164
        private System.Collections.ObjectModel.ObservableCollection<ConvertPDF> _RealConvertSource;
165
        public System.Collections.ObjectModel.ObservableCollection<ConvertPDF> RealConvertSource
166
        {
167
            get => _RealConvertSource;
168
            set
169
            {
170
                _RealConvertSource = value;
171
                OnPropertyChanged(() => RealConvertSource);
172
            }
173
        }
174

    
175

    
176
        private System.Windows.Documents.FlowDocument connectionLog;
177
        public System.Windows.Documents.FlowDocument ConnectionLog
178
        {
179
            get => connectionLog;
180
            set
181
            {
182
                if (connectionLog != value)
183
                {
184
                    connectionLog = value;
185
                    OnPropertyChanged(() => ConnectionLog);
186
                }
187
            }
188
        }
189

    
190

    
191
        private int _SelectedInt = 4;
192
        public int SelectedInt
193
        {
194
            get => _SelectedInt;
195
            set
196
            {
197
                _SelectedInt = value;
198
                OnPropertyChanged(() => SelectedInt);
199
            }
200
        }
201

    
202
        private Telerik.Windows.Data.EnumMemberViewModel _SelectedStatus;
203
        public Telerik.Windows.Data.EnumMemberViewModel SelectedStatus
204
        {
205
            get => _SelectedStatus;
206
            set
207
            {
208
                _SelectedStatus = value;
209
                OnPropertyChanged(() => SelectedStatus);
210
            }
211
        }
212

    
213

    
214
        private SelectedCountItem _SelectedCount;
215
        public SelectedCountItem SelectedCount
216
        {
217
            get => _SelectedCount;
218
            set
219
            {
220
                _SelectedCount = value;
221
                OnPropertyChanged(() => SelectedCount);
222
            }
223
        }
224

    
225
        List<SelectedCountItem> _SelectedCountList;
226
        public List<SelectedCountItem> SelectedCountList
227
        {
228
            get
229
            {
230
                if (_SelectedCountList == null)
231
                {
232
                    _SelectedCountList = new List<SelectedCountItem>
233
                    {
234
                        new SelectedCountItem{DisplayMember = "50",ValueMember = 50},
235
                        new SelectedCountItem{DisplayMember = "100",ValueMember = 100},
236
                        new SelectedCountItem{DisplayMember = "150",ValueMember = 150},
237
                        new SelectedCountItem{DisplayMember = "200",ValueMember = 200}
238
                    };
239
                }
240

    
241
                return _SelectedCountList;
242
            }
243
        }
244

    
245
        private ConvertPDF _SelectFilterConvert;
246
        public ConvertPDF SelectFilterConvert
247
        {
248
            get
249
            {
250
                return _SelectFilterConvert;
251
            }
252
            set
253
            {
254
                _SelectFilterConvert = value;
255
                OnPropertyChanged(() => SelectFilterConvert);
256
            }
257
        }
258

    
259

    
260
        private ObservableCollection<ConvertPDF> _SelectFilterConvertList;
261
        public ObservableCollection<ConvertPDF> SelectFilterConvertList
262
        {
263
            get
264
            {
265
                if (_SelectFilterConvertList == null)
266
                {
267
                    _SelectFilterConvertList = new ObservableCollection<ConvertPDF>();
268
                }
269
                return _SelectFilterConvertList;
270
            }
271
            set
272
            {
273
                _SelectFilterConvertList = value;
274
                OnPropertyChanged(() => SelectFilterConvertList);
275
            }
276
        }
277

    
278

    
279

    
280
        private ConvertPDF _SelectRealConvert;
281
        public ConvertPDF SelectRealConvert
282
        {
283
            get => _SelectRealConvert;
284
            set
285
            {
286
                _SelectRealConvert = value;
287
                OnPropertyChanged(() => SelectRealConvert);
288
            }
289
        }
290

    
291

    
292
        private ConvertPDF _SelectAliveConvert;
293
        public ConvertPDF SelectAliveConvert
294
        {
295
            get => _SelectAliveConvert;
296
            set
297
            {
298
                _SelectAliveConvert = value;
299
                OnPropertyChanged(() => SelectAliveConvert);
300
            }
301
        }
302

    
303

    
304
        private StatusTypeList _StatusType;
305
        public StatusTypeList StatusType
306
        {
307
            get => _StatusType;
308
            set
309
            {
310
                _StatusType = value;
311
                OnPropertyChanged(() => StatusType);
312
            }
313
        }
314

    
315
        private bool _IsLoading;
316
        public bool IsLoading
317
        {
318
            get => _IsLoading;
319
            set
320
            {
321
                if (_IsLoading != value)
322
                {
323
                    _IsLoading = value;
324
                    OnPropertyChanged(() => IsLoading);
325
                }
326
            }
327
        }
328

    
329
        IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> _StatusCodeList;
330
        public IEnumerable<Telerik.Windows.Data.EnumMemberViewModel> StatusCodeList
331
        {
332
            get
333
            {
334
                if (_StatusCodeList == null)
335
                {
336
                    _StatusCodeList = Telerik.Windows.Data.EnumDataSource.FromType<StatusCodeType>();
337
                }
338

    
339
                return _StatusCodeList;
340
            }
341
        }
342

    
343
        public ProjectName _ProjectNumberFilter;
344
        public ProjectName ProjectNumberFilter
345
        {
346
            get
347
            {
348
                if (_ProjectNumberFilter == null)
349
                {
350
                    _ProjectNumberFilter = new ProjectName();
351
                }
352
                return _ProjectNumberFilter;
353
            }
354
            set
355
            {
356
                _ProjectNumberFilter = value;
357
                OnPropertyChanged(() => ProjectNumberFilter);
358
            }
359
        }
360

    
361
        public string _UniqueKeyFilter;
362
        public string UniqueKeyFilter
363
        {
364
            get
365
            {
366
                return _UniqueKeyFilter;
367
            }
368
            set
369
            {
370
                if (_UniqueKeyFilter == "")
371
                {
372
                    _UniqueKeyFilter = null;
373
                }
374
                else if (_UniqueKeyFilter != value)
375
                {
376
                    _UniqueKeyFilter = value;
377
                    OnPropertyChanged(() => UniqueKeyFilter);
378
                }
379
            }
380
        }
381

    
382
        public StatusCodeType _ConvertStateFilter;
383
        public StatusCodeType ConvertStateFilter
384
        {
385
            get { return _ConvertStateFilter; }
386
            set
387
            {
388
                if (_ConvertStateFilter != value)
389
                {
390
                    _ConvertStateFilter = value;
391
                    OnPropertyChanged(() => ConvertStateFilter);
392
                }
393
            }
394
        }
395

    
396
        public string _Docuemnt_NOFilter;
397
        public string Docuemnt_NOFilter
398
        {
399
            get { return _Docuemnt_NOFilter; }
400
            set
401
            {
402
                if (_Docuemnt_NOFilter == "")
403
                {
404
                    _Docuemnt_NOFilter = null;
405
                }
406
                else if (_Docuemnt_NOFilter != value)
407
                {
408
                    _Docuemnt_NOFilter = value;
409
                    OnPropertyChanged(() => Docuemnt_NOFilter);
410
                }
411
            }
412
        }
413

    
414
        public string _Document_NameFilter;
415
        public string Document_NameFilter
416
        {
417
            get { return _Document_NameFilter; }
418
            set
419
            {
420
                if (_Document_NameFilter == "")
421
                {
422
                    _Document_NameFilter = null;
423
                }
424
                else if (_Document_NameFilter != value)
425
                {
426
                    _Document_NameFilter = value;
427
                    OnPropertyChanged(() => Document_NameFilter);
428
                }
429
            }
430
        }
431

    
432
        public int? _ReconverterFilter = 0;
433
        public int? ReconverterFilter
434
        {
435
            get { return _ReconverterFilter; }
436
            set
437
            {
438
                if (_ReconverterFilter == null)
439
                {
440
                    _ReconverterFilter = 0;
441
                }
442
                else if (_ReconverterFilter != value)
443
                {
444
                    _ReconverterFilter = value;
445
                    OnPropertyChanged(() => ReconverterFilter);
446

    
447
                }
448
            }
449
        }
450

    
451
        public string _Service_IDFilter;
452
        public string Service_IDFilter
453
        {
454
            get { return _Service_IDFilter; }
455
            set
456
            {
457
                if (_Service_IDFilter == "")
458
                {
459
                    _Service_IDFilter = null;
460
                }
461
                else if (_Service_IDFilter != value)
462
                {
463
                    _Service_IDFilter = value;
464
                    OnPropertyChanged(() => Service_IDFilter);
465
                }
466
            }
467
        }
468

    
469
        public string _RevisionFilter;
470
        public string RevisionFilter
471
        {
472
            get { return _RevisionFilter; }
473
            set
474
            {
475
                if (_RevisionFilter == "")
476
                {
477
                    _RevisionFilter = null;
478
                }
479
                else if (_RevisionFilter != value)
480
                {
481
                    _RevisionFilter = value;
482
                    OnPropertyChanged(() => RevisionFilter);
483
                }
484
            }
485
        }
486

    
487
        public string _GroupNOFilter;
488
        public string GroupNOFilter
489
        {
490
            get { return _GroupNOFilter; }
491
            set
492
            {
493
                if (_GroupNOFilter == "")
494
                {
495
                    _GroupNOFilter = null;
496
                }
497
                else if (_GroupNOFilter != value)
498
                {
499
                    _GroupNOFilter = value;
500
                    OnPropertyChanged(() => GroupNOFilter);
501
                }
502
            }
503
        }
504

    
505
        public string _DOCUMENT_URLFilter;
506
        public string DOCUMENT_URLFilter
507
        {
508
            get { return _DOCUMENT_URLFilter; }
509
            set
510
            {
511
                if (_DOCUMENT_URLFilter == "")
512
                {
513
                    _DOCUMENT_URLFilter = null;
514
                }
515
                else if (_DOCUMENT_URLFilter != value)
516
                {
517
                    _DOCUMENT_URLFilter = value;
518
                    OnPropertyChanged(() => DOCUMENT_URLFilter);
519
                }
520
            }
521
        }
522

    
523
        static DateTime DefaultCreateTime = DateTime.Now;
524
        private DateTime _SelectedCreateTimeBegin = DefaultCreateTime;
525
        public DateTime SelectedCreateTimeBegin
526
        {
527

    
528
            get { return _SelectedCreateTimeBegin; }
529
            set
530
            {
531
                if (_SelectedCreateTimeBegin == value)
532
                    return;
533
                _SelectedCreateTimeBegin = value;
534
                OnPropertyChanged(() => SelectedCreateTimeBegin);
535

    
536
            }
537
        }
538

    
539
        private DateTime _SelectedCreateTimeEnd = DefaultCreateTime;
540
        public DateTime SelectedCreateTimeEnd
541
        {
542

    
543
            get { return _SelectedCreateTimeEnd; }
544
            set
545
            {
546
                if (_SelectedCreateTimeEnd == value)
547
                    return;
548
                _SelectedCreateTimeEnd = value;
549
                OnPropertyChanged(() => SelectedCreateTimeEnd);
550
            }
551
        }
552

    
553
        public bool _ConvertShow;
554
        public bool ConvertShow
555
        {
556
            get => _ConvertShow;
557
            set
558
            {
559
                if (_ConvertShow = !value)
560
                {
561
                    _ConvertShow = false;
562
                }
563
                _ConvertShow = value;
564
                OnPropertyChanged(() => ConvertShow);
565
            }
566
        }
567

    
568
        #endregion
569

    
570
        #region Command
571

    
572
        public DelegateCommand ConvertCommand { get; private set; }
573
        public DelegateCommand DeleteCommand { get; private set; }
574
        public DelegateCommand ValidateCommand { get; private set; }
575
        public DelegateCommand DataSaveFileGemBoxCommand { get; private set; }
576
        public DelegateCommand MarkusLinkCommand { get; private set; }
577
        public DelegateCommand RemoveCreateTimeFilterCommand { get; private set; }
578

    
579
        public DelegateCommand DataFilterCommand { get; private set; }
580
        public DelegateCommand ResetCommand { get; private set; }
581
        public DelegateCommand ConvertAddCommand { get; private set; }
582
        public DelegateCommand ConvertPathFileSearchCommand { get; private set; }
583

    
584
        #endregion
585

    
586
        #region Main Logic
587

    
588
        /// <summary>
589
        /// 각각의 Grid row 객체들 업데이트
590
        /// </summary>
591

    
592
        private DispatcherTimer dispatcherTimer;
593
        public override void Loaded()
594
        {
595
            base.Loaded();
596

    
597
            if (!App.IsDesignMode)
598
            {
599
                dispatcherTimer = new DispatcherTimer();
600
                dispatcherTimer.Tick += new EventHandler(Timer_Tick);
601
                dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
602
                dispatcherTimer.Start();
603
            }
604
        }
605

    
606
        private async void Timer_Tick(object sender, EventArgs e)
607
        {
608
            dispatcherTimer.Stop();
609

    
610
            if (IsAcitve)
611
            {
612
                await App.Current.Dispatcher.InvokeAsync(() =>
613
                {
614
                    DataSelect();
615

    
616
                    AliveDataSelect();
617
                });
618
            }
619

    
620
            await Task.Delay(5000);
621

    
622
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 0, 100));
623

    
624
            dispatcherTimer.Start();
625
        }
626

    
627
        private async void SearchTimer_Tick(object sender, EventArgs e)
628
        {
629
            dispatcherTimer.Stop();
630

    
631
            if (IsAcitve)
632
            {
633
                await App.Current.Dispatcher.InvokeAsync(() =>
634
                {
635
                    DataSearch(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
636

    
637
                    RealDataSelect(new[] { StatusCodeType.None, StatusCodeType.Wait, StatusCodeType.PageLoading, StatusCodeType.Saving }, RealConvertSource);
638

    
639
                    AliveDataSelect();
640
                });
641
            }
642

    
643
            await Task.Delay(5000);
644
            //await Task.Delay(10000);
645

    
646
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 0, 0, 100));
647

    
648
            dispatcherTimer.Start();
649
        }
650

    
651
        public override void Closed()
652
        {
653
            if (dispatcherTimer != null)
654
            {
655
                dispatcherTimer.Stop();
656
            }
657

    
658
            base.Closed();
659
        }
660

    
661

    
662
        #endregion
663

    
664
        #region Function
665

    
666
        #region Return_FilterConvertSource
667

    
668
        public static void Return_FilterConvertSource(ObservableCollection<ConvertPDF> convertPDFs)
669
        {
670
            ConvertSource = new ObservableCollection<ConvertPDF>();
671
            ConvertSource = convertPDFs;
672
        }
673

    
674
        public static ObservableCollection<ConvertPDF> Return_FilterConvertSource()
675
        {
676
            return ConvertSource;
677
        }
678

    
679
        #endregion
680

    
681

    
682
        #region Data Select
683

    
684
        /// <summary>
685
        /// 상단 그리드 중앙 그리드 출력 데이터
686
        /// </summary>
687
        private void DataSelect()
688
        {
689

    
690
            if (FilterConvertSource == null)
691
            {
692
                FilterConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
693
            }
694

    
695
            if (RealConvertSource == null)
696
            {
697
                RealConvertSource = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
698
            }
699

    
700
            /// combobox 에서 선택된 items
701
            if (SelectedStatus != null)
702
            {
703
                DataSelect(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
704
            }
705

    
706

    
707
            /// 컨버터중인 items
708
            RealDataSelect(new[] { StatusCodeType.None, StatusCodeType.Wait, StatusCodeType.PageLoading, StatusCodeType.Saving }, RealConvertSource);
709

    
710
        }
711

    
712
        private async void RealDataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertPDF> collection)
713
        {
714
            try
715
            {
716
                List<ConvertPDF> Listitems = new List<ConvertPDF>();
717

    
718
                foreach (var coll in collection)
719
                {
720
                   var collectionItems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(coll.ConvertID, coll.ProjectNumber, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
721
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
722
                                select new ConvertPDF(num.SERVICE_ID, num.ID, num.PROJECT_NO, num.STATUS, num.DOCUMENT_ID, num.DOCUMENT_NAME, num.DOCUMENT_NO, num.DOCUMENT_URL, num.REVISION, num.CURRENT_PAGE,
723
                            num.TOTAL_PAGE, num.EXCEPTION, num.GROUP_NO, num.CREATE_DATETIME, num.START_DATETIME, num.END_DATETIME, num.DOCUMENT_URL, num.CONVERT_PATH, MarkusLink, num.RECONVERTER);
724

    
725
                    var collectionItem = collectionItems.Cast<ConvertPDF>().ToList();
726

    
727
                    Listitems.AddRange(collectionItem);
728
                }
729

    
730
                foreach (var Listitem in Listitems)
731
                {
732
                    collection.UpdateWhere(changeitem =>
733
                    ConvertItemEx.ChangeValues(changeitem, Listitem), x => x.ProjectNumber == Listitem.ProjectNumber && x.ConvertID == Listitem.ConvertID);
734
                }
735
            }
736
            catch (Exception ex)
737
            {
738
                MessageBox.Show(ex.ToString());
739
            }
740
        }
741

    
742
        private async void DataSelect(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertPDF> collection)
743
        {
744
            try
745
            {
746
                int _status = 0;
747
                if (SelectedStatus != null)
748
                {
749
                    _status = (int)SelectedStatus.Value;
750
                }
751

    
752
                if (ProjectNames.Count() == 0)
753
                {
754
                    ProjectName Clear = new ProjectName("Clear", "Clear");
755
                    ProjectNames.Add(Clear);
756

    
757
                    foreach (var x in await WcfClient.GET_SELECT_RUN_PROJECTSAsync(0))
758
                    {
759
                        ProjectName projectName = new ProjectName(x.PROJECT_NO, x.PROJECT_NAME);
760
                        ProjectNames.Add(projectName);
761
                    }
762
                }
763

    
764
                var Listitems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(null, null, null, _status, SelectedCount.ValueMember, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
765
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
766
                                select new ConvertPDF(num.SERVICE_ID, num.ID, num.PROJECT_NO, num.STATUS, num.DOCUMENT_ID, num.DOCUMENT_NAME, num.DOCUMENT_NO, num.DOCUMENT_URL, num.REVISION, num.CURRENT_PAGE,
767
                                                        num.TOTAL_PAGE, num.EXCEPTION, num.GROUP_NO, num.CREATE_DATETIME, num.START_DATETIME, num.END_DATETIME, num.DOCUMENT_URL, num.CONVERT_PATH, MarkusLink, num.RECONVERTER);
768

    
769
                if (collection.Count() == 0)
770
                {
771
                    if (statusCodeTypeList.Count() == 1)
772
                    {
773
                        //Listitems.ForEach(x => collection.Add(x));
774
                        foreach (var Listitem in Listitems.ToList())
775
                        {
776
                            collection.Add(Listitem);
777
                        }
778
                    }
779
                }
780
                else
781
                {
782
                    foreach (var Listitem in Listitems)
783
                    {
784
                        collection.UpdateWhere(changeitem =>
785
                        ConvertItemEx.ChangeValues(changeitem, Listitem), x => x.ProjectNumber == Listitem.ProjectNumber && x.ConvertID == Listitem.ConvertID);
786
                    }
787
                    if (statusCodeTypeList.Count() == 1)
788
                    {
789
                        for (int i = collection.Count() - 1; i >= 0; --i)
790
                        {
791
                            var item = collection[i];
792

    
793
                            if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
794
                            {
795
                                collection.RemoveAt(i);
796
                            }
797
                        }
798
                    }
799

    
800
                    if (statusCodeTypeList.Count() == 1)
801
                    {
802
                        foreach (var item in Listitems)
803
                        {
804
                            if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
805
                            {
806
                                for (int i = 0; i < 200; i++)
807
                                {
808
                                    if (i < collection.Count() - 1)
809
                                    {
810
                                        if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
811
                                        {
812
                                            collection.Insert(i, item);
813
                                            break;
814
                                        }
815
                                    }
816
                                    else
817
                                    {
818
                                        collection.Add(item);
819
                                        break;
820
                                    }
821
                                }
822

    
823
                            }
824

    
825
                        }
826
                    }
827
                }
828
            }
829
            catch (Exception ex)
830
            {
831
                MessageBox.Show(ex.ToString());
832
                //System.Diagnostics.Debug.WriteLine(ex.ToString());
833
            }
834
        }
835

    
836
        private async void DataSearch(IEnumerable<StatusCodeType> statusCodeTypeList, System.Collections.ObjectModel.ObservableCollection<ConvertPDF> collection)
837
        {
838
            try
839
            {
840
                int _status = 0;
841
                if (SelectedStatus != null)
842
                {
843
                    _status = (int)SelectedStatus.Value;
844
                }
845

    
846
                //DocumentID = unikey
847
                DateTime? Start_CreateTime = null;
848
                DateTime? Finish_CreateTime = null;
849
                if (SelectedCreateTimeBegin != DefaultCreateTime)
850
                {
851
                    Start_CreateTime = SelectedCreateTimeBegin;
852
                }
853
                if (SelectedCreateTimeEnd != DefaultCreateTime)
854
                {
855
                    Finish_CreateTime = SelectedCreateTimeEnd;
856
                }
857

    
858
                if (ProjectNames.Count() == 0)
859
                {
860
                    foreach (var x in await WcfClient.GET_SELECT_RUN_PROJECTSAsync(0))
861
                    {
862
                        ProjectName projectName = new ProjectName(x.PROJECT_NO, x.PROJECT_NAME);
863
                        ProjectNames.Add(projectName);
864
                    }
865
                }
866

    
867
                var Listitems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(null, ProjectNumberFilter.Project_NO, UniqueKeyFilter, _status, SelectedCount.ValueMember, Start_CreateTime, Finish_CreateTime, null,
868
            null, null, null, GroupNOFilter, Document_NameFilter, Docuemnt_NOFilter, RevisionFilter, Service_IDFilter, ReconverterFilter, DOCUMENT_URLFilter, ExcptionCheck)
869
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
870
                                select new ConvertPDF(num.SERVICE_ID, num.ID, num.PROJECT_NO, num.STATUS, num.DOCUMENT_ID, num.DOCUMENT_NAME, num.DOCUMENT_NO, num.DOCUMENT_URL, num.REVISION, num.CURRENT_PAGE,
871
           num.TOTAL_PAGE, num.EXCEPTION, num.GROUP_NO, num.CREATE_DATETIME, num.START_DATETIME, num.END_DATETIME, num.DOCUMENT_URL, num.CONVERT_PATH, MarkusLink, num.RECONVERTER);
872

    
873
                if (collection.Count() == 0)
874
                {
875
                    if (statusCodeTypeList.Count() == 1)
876
                    {
877
                        foreach (var x in Listitems)
878
                        {
879
                            collection.Add(x);
880
                        }
881
                    }
882
                }
883
                else
884
                {
885

    
886
                    ////세미 업데이트
887
                    foreach (var newitem in Listitems)
888
                    {
889
                        collection.UpdateWhere(changeitem =>
890
                        ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
891
                    }
892

    
893

    
894
                    if (statusCodeTypeList.Count() == 1)
895
                    {
896

    
897
                        //삭제
898
                        for (int i = collection.Count() - 1; i >= 0; --i)
899
                        {
900
                            var item = collection[i];
901

    
902
                            if (Listitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
903
                            {
904
                                collection.RemoveAt(i);
905
                            }
906
                        }
907
                    }
908

    
909
                    if (statusCodeTypeList.Count() == 1)
910
                    {
911
                        //추가 convert 후 추가됨
912
                        foreach (var item in Listitems)
913
                        {
914
                            if (collection.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
915
                            {
916
                                for (int i = 0; i < 200; i++)
917
                                {
918
                                    if (i < collection.Count() - 1)
919
                                    {
920
                                        if (DateTime.Compare(collection[i].CreateTime, item.CreateTime) < 0)
921
                                        {
922
                                            collection.Insert(i, item);
923
                                            break;
924
                                        }
925
                                    }
926
                                    else
927
                                    {
928
                                        collection.Add(item);
929
                                        break;
930
                                    }
931
                                }
932
                            }
933
                        }
934
                    }
935
                }
936
            }
937
            catch (Exception ex)
938
            {
939
                MessageBox.Show(ex.ToString());
940
                //System.Diagnostics.Debug.WriteLine(ex.ToString());
941
            }
942
        }
943
        /// <summary>
944
        /// 서비스의 실시간 컨버터 Item
945
        /// </summary>
946
        private async void AliveDataSelect()
947
        {
948
            try
949
            {
950
                List<ConvertPDF> newitems = new List<ConvertPDF>();
951
                foreach (var client in App.StationClientList)
952
                {
953
                    if (await SimplePingAsync(client.Endpoint.Address.ToString()))
954
                    {
955
                        try
956
                        {
957
                            List<ConvertPDF> itemsToList = new List<ConvertPDF>();
958
                            var items = await client.AliveConvertListAsync();
959
                            string result = "";
960

    
961
                            foreach (var item in items)
962
                            {
963
                                ConvertPDF itemsToEach = new ConvertPDF();
964
                                itemsToEach.ServiceID = item.ServiceID;
965
                                itemsToEach.ConvertID = item.ConvertID;
966
                                itemsToEach.ProjectNumber = item.ProjectNumber;
967

    
968
                                var MarkusLink = "kcom://" + CreateMarkusParam(item.ProjectNumber, item.DocumentID, "doftech");
969

    
970
                                if (item.ConvertState != null)
971
                                {
972
                                    itemsToEach.ConvertState = (StatusCodeType)Enum.Parse(typeof(StatusCodeType), item.ConvertState);
973
                                }
974

    
975
                                if (item.OriginfilePath.Contains("/"))
976
                                {
977
                                    result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("/") + 1);
978
                                }
979
                                else
980
                                {
981
                                    result = item.OriginfilePath.Substring(item.OriginfilePath.LastIndexOf("%") + 1);
982
                                }
983
                                itemsToEach.FileName = result;
984

    
985
                                itemsToEach.CurrentPageNo = item.CurrentPageNo;
986
                                itemsToEach.TotalPage = item.TotalPage;
987
                                itemsToEach.OriginfilePath = item.OriginfilePath;
988
                                itemsToEach.ConvertPath = item.ConvertPath;
989
                                itemsToEach.MarkusLink = MarkusLink;
990
                                itemsToEach.UniqueKey = item.UniqueKey;//DocumentNO 없음
991
                                itemsToEach.GroupNo = item.GroupNo;//없음 
992
                                //itemsToEach.ProcessorAffinity = item.ProcessorAffinity;
993
                                itemsToEach.DocumentName = item.DocumnetName;
994
                                itemsToEach.Revision = item.Revision; //없음 
995
                                itemsToEach.Exception = item.Exception;//없음
996
                                itemsToEach.ConvertPath = item.ConvertPath;
997
                                itemsToEach.CreateTime = item.CreateTime;
998
                                itemsToEach.ReConverter = item.ReConverter;
999
                                itemsToEach.DocumentID = item.DocumentID;
1000
                                itemsToEach.StartTime = item.StartTime;
1001
                                itemsToEach.EndTime = item.EndTime;
1002

    
1003
                                itemsToList.Add(itemsToEach);
1004
                            }
1005
                            newitems.AddRange(itemsToList);
1006
                            System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} ping");
1007

    
1008
                            if (items.Count() == 0)
1009
                            {
1010
                                System.Diagnostics.Trace.WriteLine($"{client.Endpoint.Address} Alive Items is zero.");
1011
                            }
1012
                        }
1013
                        catch (Exception ex)
1014
                        {
1015
                            System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} {ex.Message}");
1016
                        }
1017
                    }
1018
                    else
1019
                    {
1020
                        System.Diagnostics.Trace.Fail($"{client.Endpoint.Address} ping Error");
1021
                    }
1022

    
1023
                }
1024
                ItemsUpdate(newitems);
1025
                await System.Windows.Application.Current.Dispatcher.InvokeAsync(() => ItemsUpdate(newitems));
1026
            }
1027
            catch (Exception ex)
1028
            {
1029
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1030
            }
1031
        }
1032

    
1033
        /// <summary>
1034
        /// AliveDataSelect의 Data Update
1035
        /// </summary>
1036
        /// <param name="newitems"></param>
1037
        private void ItemsUpdate(List<ConvertPDF> newitems)
1038
        {
1039

    
1040
            foreach (var item in newitems)
1041
            {
1042
                item.OriginfilePath = HttpUtility.UrlDecode(item.OriginfilePath);
1043
            }
1044

    
1045
            if (AliveItems == null)
1046
            {
1047
                AliveItems = new System.Collections.ObjectModel.ObservableCollection<ConvertPDF>();
1048

    
1049
                foreach (var item in newitems)
1050
                {
1051
                    AliveItems.Add(item);
1052
                }
1053
            }
1054
            else
1055
            {
1056
                /// 데이터 업데이트
1057
                newitems.ForEach(newitem =>
1058
                {
1059
                    AliveItems.UpdateWhere(changeitem => ConvertItemEx.ChangeValues(changeitem, newitem), x => x.ProjectNumber == newitem.ProjectNumber && x.ConvertID == newitem.ConvertID);
1060
                });
1061

    
1062
                // 추가
1063
                foreach (var item in newitems)
1064
                {
1065
                    if (AliveItems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
1066
                    {
1067
                        AliveItems.Add(item);
1068
                    }
1069
                }
1070

    
1071
                /// 삭제
1072

    
1073
                for (int i = AliveItems.Count() - 1; i > -1; --i)
1074
                {
1075
                    var item = AliveItems[i];
1076

    
1077
                    if (newitems.Count(x => x.ConvertID == item.ConvertID && x.ProjectNumber == item.ProjectNumber) == 0)
1078
                    {
1079
                        try
1080
                        {
1081
                            AliveItems.RemoveAt(i);
1082
                        }
1083
                        catch (Exception ex)
1084
                        {
1085
                            System.Diagnostics.Debug.WriteLine(ex.ToString());
1086
                        }
1087
                    }
1088
                }
1089
            }
1090
        }
1091

    
1092

    
1093
        public static async Task<bool> SimplePingAsync(string uri)
1094
        {
1095
            bool result = false;
1096

    
1097
            try
1098
            {
1099
                using (System.Net.Http.HttpClient Client = new System.Net.Http.HttpClient())
1100
                {
1101
                    Client.Timeout = new TimeSpan(0, 0, 60);
1102

    
1103
                    var message = await Client.GetAsync(uri);
1104

    
1105
                    System.Net.HttpStatusCode StatusCode = message.StatusCode;
1106

    
1107
                    switch (StatusCode)
1108
                    {
1109

    
1110
                        case System.Net.HttpStatusCode.Accepted:
1111
                        case System.Net.HttpStatusCode.OK:
1112
                            result = true;
1113
                            break;
1114
                    }
1115
                }
1116
            }
1117
            catch (Exception ex)
1118
            {
1119
                result = false;
1120
                System.Diagnostics.Debug.WriteLine(ex.ToString());
1121
            }
1122

    
1123
            return result;
1124
        }
1125

    
1126
        #endregion
1127

    
1128
        #region Data Convert
1129

    
1130
        private async void DataConvert(object obj)
1131
        {
1132
            if (SelectFilterConvertList == null)
1133
            {
1134
                MessageBox.Show("왼쪽 버튼 클릭 후 Converter 해주세요!");
1135
            }
1136
            else
1137
            {
1138
                if (SelectRealConvert != null)
1139
                {
1140
                    SetCleanUpItem(SelectRealConvert);//ConvertDataBase
1141
                }
1142
                if (SelectFilterConvertList != null)
1143
                {
1144
                    foreach (var SelectFilterConvert in SelectFilterConvertList)
1145
                    {
1146
                        SetCleanUpItem(SelectFilterConvert);
1147
                    }
1148
                }
1149

    
1150
                foreach (var SelectFilterConvert in SelectFilterConvertList)
1151
                {
1152

    
1153
                    var items = from x in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(SelectFilterConvert.ConvertID, null, null, null, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null)
1154
                                let MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech")
1155
                                select new ConvertPDF(x.SERVICE_ID, x.ID, x.PROJECT_NO, x.STATUS, x.DOCUMENT_ID, x.DOCUMENT_NAME, x.DOCUMENT_NO, x.DOCUMENT_URL, x.REVISION, x.CURRENT_PAGE, x.TOTAL_PAGE, x.EXCEPTION, x.GROUP_NO, x.CREATE_DATETIME, x.START_DATETIME, x.END_DATETIME
1156
                             , x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
1157

    
1158
                    foreach (var item in items)
1159
                    {
1160
                        RealConvertSource.Add(item);
1161

    
1162
                        if (RealConvertSource.Count() == 1)
1163
                        {
1164
                            ConvertShow = true;
1165
                        }
1166
                    }
1167
                }
1168
            }
1169
        }
1170

    
1171

    
1172
        public async void SetCleanUpItem(ConvertPDF _ConvertItem)
1173
        {
1174
        
1175
            var items = await WcfClient.GET_SELECT_CONVERT_ITEMAsync(_ConvertItem.ConvertID, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
1176
       
1177
            if (items.Count() > 0)
1178
            {
1179
                var item = items.First();
1180

    
1181
                var _RECONVERTER = item.RECONVERTER - _ConvertItem.ReConverter;
1182
                var _CREATE_DATETIME = DateTime.Now;
1183
                var _STATUS = (int)StatusCodeType.None;
1184

    
1185
                await WcfClient.GET_SELECT_RERECONVERT_ITEMAsync(_ConvertItem.ConvertID, _RECONVERTER, _CREATE_DATETIME, _STATUS, null);//_END_DATETIME = null 에러
1186
            }
1187
        }
1188

    
1189

    
1190
        public static string CreateMarkusParam(string projectNo, string documentID, string userID)
1191
        {
1192
            ViewInfo viewInfo = new ViewInfo();
1193

    
1194
            viewInfo.DocumentItemID = documentID;
1195
            viewInfo.ProjectNO = projectNo;
1196
            viewInfo.UserID = userID;
1197

    
1198
            return ParamEncoding(JsonConvert.SerializeObject(viewInfo));
1199

    
1200
        }
1201

    
1202
        public static string ParamEncoding(string EncodingText, System.Text.Encoding oEncoding = null)
1203
        {
1204

    
1205
            if (oEncoding == null)
1206
                oEncoding = System.Text.Encoding.UTF8;
1207

    
1208
            return Convert.ToBase64String(oEncoding.GetBytes(EncodingText));
1209

    
1210
        }
1211

    
1212

    
1213
        #endregion
1214

    
1215
        #region Validation
1216

    
1217
        private void DataValidate(object obj)
1218
        {
1219
            if (SelectFilterConvertList.Count() > 1)
1220
            {
1221
                MessageBox.Show("하나만 클릭해 주세요");
1222
            }
1223
            else
1224
            {
1225
                bool result = false;
1226
                WebRequest webRequest = WebRequest.Create(SelectFilterConvertList[0].OriginfilePath);
1227
                webRequest.Timeout = 1200; // miliseconds
1228
                webRequest.Method = "HEAD";
1229

    
1230
                HttpWebResponse response = null;
1231

    
1232
                try
1233
                {
1234
                    response = (HttpWebResponse)webRequest.GetResponse();
1235
                    result = true;
1236
                }
1237
                catch (WebException webException)
1238
                {
1239
                    MessageBox.Show(SelectFilterConvert.FileName + " doesn't exist: " + webException.Message);
1240
                    result = true;
1241
                }
1242
                finally
1243
                {
1244
                    if (response != null)
1245
                    {
1246
                        response.Close();
1247
                    }
1248
                }
1249
                if (result == true)
1250
                {
1251
                    MessageBox.Show("File exists");
1252
                }
1253
            }
1254

    
1255
        }
1256

    
1257
        #endregion
1258

    
1259
        #region DataFilter
1260

    
1261
        public void DataFilter(object obj)
1262
        {
1263
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1264
            dispatcherTimer.Tick += new EventHandler(SearchTimer_Tick);
1265
            //DataSearch(new[] { (StatusCodeType)(SelectedStatus.Value) }, FilterConvertSource);
1266
        }
1267

    
1268
        #endregion
1269

    
1270
        #region MarkusLink
1271

    
1272
        private void MarkusLink(object obj)
1273
        {
1274
            if (obj is ConvertPDF)
1275
            {
1276

    
1277
                if (obj != null)
1278
                {
1279
                    var convertitem = obj as ConvertPDF;
1280

    
1281
                    SelectFilterConvertList.Add(convertitem);
1282

    
1283
                    SelectRealConvert = convertitem;
1284

    
1285
                    ProcessStartInfo startInfo = null;
1286

    
1287
                    startInfo = new ProcessStartInfo("iexplore.exe", convertitem.MarkusLink);
1288

    
1289
                    Process.Start(startInfo);
1290
                }
1291

    
1292
            }
1293
        }
1294

    
1295
        #endregion
1296

    
1297
        #region Data Delete
1298

    
1299
        private void DataDelete(object obj)
1300
        {
1301
            RadWindow.Alert("Do you want to delete it??", this.OnClosed);
1302
        }
1303

    
1304
        private async void OnClosed(object sender, WindowClosedEventArgs e)
1305
        {
1306
            {
1307
                var result = e.DialogResult;
1308
                if (result == true)
1309
                {
1310
                    if (SelectFilterConvertList.Count() > 1)
1311
                    {
1312
                        MessageBox.Show("하나만 클릭해 주세요!");
1313
                    }
1314
                    else
1315
                    {
1316
                        if (SelectRealConvert != null)
1317
                        {
1318
                            await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectRealConvert.ConvertID);
1319
                        }
1320
                        if (SelectFilterConvertList != null)
1321
                        {
1322
                            await WcfClient.GET_SELECT_CONVERT_DELETEAsync(SelectFilterConvertList[0].ConvertID);
1323
                        }
1324
                    }
1325
                }
1326
            }
1327
        }
1328
        #endregion
1329

    
1330
        #region Data Export
1331

    
1332

    
1333
        /// <summary>
1334
        /// 필터된 상단 그리드 엑셀로 출력
1335
        /// </summary>
1336

    
1337
        public void DataExportData(object obj)
1338
        {
1339
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1340

    
1341
            Return_FilterConvertSource(FilterConvertSource);
1342

    
1343
            Views.ConvertExcelDialog convertExcelDialog = new Views.ConvertExcelDialog();
1344

    
1345
            convertExcelDialog.Owner = Application.Current.MainWindow;
1346
            convertExcelDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1347

    
1348
            convertExcelDialog.ShowDialog();
1349

    
1350

    
1351
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1352
        }
1353

    
1354
        #endregion
1355

    
1356
        #region Data Search
1357

    
1358
        public void RemoveCreateTimeFilter(object obj)
1359
        {
1360
            DefaultCreateTime = DateTime.Now;
1361
            SelectedCreateTimeBegin = DefaultCreateTime;
1362
            SelectedCreateTimeEnd = DefaultCreateTime;
1363
        }
1364

    
1365
        #endregion
1366

    
1367
        #region Reset
1368

    
1369
        /// <summary>
1370
        /// 그리드 상단 원상복귀 버튼
1371
        /// 필터를 끝낸 후 다시 복귀
1372
        /// </summary>
1373

    
1374
        public void Reset(object obj)
1375
        {
1376
            ExcptionCheck = false;
1377
            SelectedInt = 10;
1378
            ProjectNumberFilter = ProjectNames[0];
1379
            UniqueKeyFilter = null;
1380
            Service_IDFilter = null;
1381
            Document_NameFilter = null;
1382
            Docuemnt_NOFilter = null;
1383
            ReconverterFilter = null;
1384
            RevisionFilter = null;
1385
            GroupNOFilter = null;
1386
            DOCUMENT_URLFilter = null;
1387
            DefaultCreateTime = DateTime.Now;
1388
            SelectedCreateTimeBegin = DefaultCreateTime;
1389
            SelectedCreateTimeEnd = DefaultCreateTime;
1390
            dispatcherTimer.Tick -= new EventHandler(SearchTimer_Tick);
1391
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1392
        }
1393

    
1394
        #endregion
1395

    
1396
        #region ConvertAddDialog
1397

    
1398
        /// <summary>
1399
        /// 그리드 상단 Conver 추가 버튼
1400
        /// ProjectNo, DocumentURL, DocumentID, 입력해서 저장 프로시저에서 추가 
1401
        /// </summary>
1402

    
1403
        public void ConvertAdd(object obj)
1404
        {
1405
            dispatcherTimer.Tick -= new EventHandler(Timer_Tick);
1406

    
1407
            Views.ConvertAddDialog convertAddDialog = new Views.ConvertAddDialog();
1408

    
1409
            convertAddDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1410

    
1411
            convertAddDialog.ShowDialog();
1412

    
1413
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1414
        }
1415

    
1416
        #endregion
1417

    
1418

    
1419
        #region ConvertPathFileSearch
1420

    
1421
        /// <summary>
1422
        ///  ConvertPath 파일 탐색기로 열리는 아이콘
1423
        /// </summary>
1424

    
1425
        public void ConvertPathFileSearch(object obj)
1426
        {
1427
            if (obj is ConvertPDF)
1428
            {
1429
                if (obj != null)
1430
                {
1431
                    var convertitem = obj as ConvertPDF;
1432

    
1433
                    if (!string.IsNullOrEmpty(convertitem.ConvertPath))
1434
                    {
1435
                        System.Diagnostics.Process.Start("explorer.exe", convertitem.ConvertPath);
1436
                    }
1437
                }
1438
            }
1439
        }
1440

    
1441
        #endregion
1442

    
1443
        #endregion
1444
    }
1445
}
클립보드 이미지 추가 (최대 크기: 500 MB)