프로젝트

일반

사용자정보

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

markus / ConvertService / ServiceBase / Markus.Service.StationController / ViewModel / DataBaseItemsModel.cs @ 72862ad1

이력 | 보기 | 이력해설 | 다운로드 (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
                    foreach (var x in await WcfClient.GET_SELECT_RUN_PROJECTSAsync(0))
757
                    {
758
                        ProjectName projectName = new ProjectName(x.PROJECT_NO, x.PROJECT_NAME);
759
                        ProjectNames.Add(projectName);
760
                    }
761
                }
762

    
763
                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)
764
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
765
                                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,
766
                                                        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);
767

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

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

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

    
822
                            }
823

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

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

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

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

    
866
                var Listitems = from num in await WcfClient.GET_SELECT_CONVERT_ITEMAsync(null, ProjectNumberFilter.Project_NO, UniqueKeyFilter, _status, SelectedCount.ValueMember, Start_CreateTime, Finish_CreateTime, null,
867
            null, null, null, GroupNOFilter, Document_NameFilter, Docuemnt_NOFilter, RevisionFilter, Service_IDFilter, ReconverterFilter, DOCUMENT_URLFilter, ExcptionCheck)
868
                                let MarkusLink = "kcom://" + CreateMarkusParam(num.PROJECT_NO, num.DOCUMENT_ID, "doftech")
869
                                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,
870
           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);
871

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

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

    
892

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
1070
                /// 삭제
1071

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

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

    
1091

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

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

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

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

    
1106
                    switch (StatusCode)
1107
                    {
1108

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

    
1122
            return result;
1123
        }
1124

    
1125
        #endregion
1126

    
1127
        #region Data Convert
1128

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

    
1149
                foreach (var SelectFilterConvert in SelectFilterConvertList)
1150
                {
1151

    
1152
                    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)
1153
                                let MarkusLink = "kcom://" + CreateMarkusParam(x.PROJECT_NO, x.DOCUMENT_ID, "doftech")
1154
                                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
1155
                             , x.DOCUMENT_URL, x.CONVERT_PATH, MarkusLink, x.RECONVERTER);
1156

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

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

    
1170

    
1171
        public async void SetCleanUpItem(ConvertPDF _ConvertItem)
1172
        {
1173
        
1174
            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);
1175
       
1176
            if (items.Count() > 0)
1177
            {
1178
                var item = items.First();
1179

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

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

    
1188

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

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

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

    
1199
        }
1200

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

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

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

    
1209
        }
1210

    
1211

    
1212
        #endregion
1213

    
1214
        #region Validation
1215

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

    
1229
                HttpWebResponse response = null;
1230

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

    
1254
        }
1255

    
1256
        #endregion
1257

    
1258
        #region DataFilter
1259

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

    
1267
        #endregion
1268

    
1269
        #region MarkusLink
1270

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

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

    
1280
                    SelectFilterConvertList[0] = convertitem;
1281

    
1282
                    SelectRealConvert = convertitem;
1283

    
1284
                    ProcessStartInfo startInfo = null;
1285

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

    
1288
                    Process.Start(startInfo);
1289
                }
1290

    
1291
            }
1292
        }
1293

    
1294
        #endregion
1295

    
1296
        #region Data Delete
1297

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

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

    
1329
        #region Data Export
1330

    
1331

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

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

    
1340
            Return_FilterConvertSource(FilterConvertSource);
1341

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

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

    
1347
            convertExcelDialog.ShowDialog();
1348

    
1349

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

    
1353
        #endregion
1354

    
1355
        #region Data Search
1356

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

    
1364
        #endregion
1365

    
1366
        #region Reset
1367

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

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

    
1392
        #endregion
1393

    
1394
        #region ConvertAddDialog
1395

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

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

    
1405
            Views.ConvertAddDialog convertAddDialog = new Views.ConvertAddDialog();
1406

    
1407
            convertAddDialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;
1408

    
1409
            convertAddDialog.ShowDialog();
1410

    
1411
            dispatcherTimer.Tick += new EventHandler(Timer_Tick);
1412
        }
1413

    
1414
        #endregion
1415

    
1416

    
1417
        #region ConvertPathFileSearch
1418

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

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

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

    
1439
        #endregion
1440

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