프로젝트

일반

사용자정보

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

markus / KCOM / MainWindow.xaml.cs @ a0d7575c

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

1 787a4489 KangIngu
using KCOM.Common;
2 32af2c3b djkim
using KCOM.Controls;
3 264c9309 ljiyeon
using KCOM.Views;
4 787a4489 KangIngu
using KCOMDataModel;
5
using KCOMDataModel.DataModel;
6 b0fb3ad7 ljiyeon
using MarkupToPDF.Common;
7 5529d2a2 humkyung
using MarkupToPDF.Controls.Parsing;
8 b0fb3ad7 ljiyeon
using MarkupToPDF.Serialize.Core;
9
using MarkupToPDF.Serialize.S_Control;
10 787a4489 KangIngu
using System;
11
using System.Collections.Generic;
12 264c9309 ljiyeon
using System.ComponentModel;
13
using System.Diagnostics;
14 6707a5c7 ljiyeon
using System.IO;
15 787a4489 KangIngu
using System.Linq;
16 264c9309 ljiyeon
using System.Net;
17
using System.Reflection;
18 71bfd53e ljiyeon
using System.Runtime.InteropServices;
19 787a4489 KangIngu
using System.Text;
20 264c9309 ljiyeon
using System.Threading;
21
using System.Threading.Tasks;
22 787a4489 KangIngu
using System.Windows;
23
using System.Windows.Controls;
24
using System.Windows.Data;
25
using System.Windows.Documents;
26
using System.Windows.Input;
27
using System.Windows.Media;
28
using System.Windows.Media.Imaging;
29
using System.Windows.Navigation;
30
using System.Windows.Shapes;
31 6707a5c7 ljiyeon
using System.Xml;
32 992a98b4 KangIngu
using Telerik.Windows.Controls;
33 7e2d29a0 ljiyeon
using WinInterop = System.Windows.Interop;
34 787a4489 KangIngu
35
namespace KCOM
36
{
37
    /// <summary>
38
    /// MainWindow.xaml에 대한 상호 작용 논리
39
    /// </summary>
40 68302e9d taeseongkim
    public partial class MainWindow : KCOM.Controls.CustomizedWindow.CustomWindow
41 787a4489 KangIngu
    {
42 32af2c3b djkim
        bool isSaveCheck = false;
43 d33ef543 taeseongkim
44 32af2c3b djkim
        ProgressControl progressControl = null;
45
        string destfilepath = string.Empty;
46
47 787a4489 KangIngu
        public MainWindow()
48
        {
49 e0cfc73c ljiyeon
            App.splashString(ISplashMessage.MAINWINDOW);
50 c362d2a5 taeseongkim
51 787a4489 KangIngu
            this.Loaded += MainWindow_Loaded;
52 eeb0a39c taeseongkim
            this.Unloaded += MainWindow_Unloaded;
53 d97dbc7f taeseongkim
            this.Activated += MainWindow_Activated;
54
        }
55 9d5b4bc2 taeseongkim
      
56 2007ecaa taeseongkim
57 d97dbc7f taeseongkim
        private void MainWindow_Activated(object sender, EventArgs e)
58
        {
59
            this.Topmost = true;
60 448c5399 taeseongkim
            this.Topmost = false;
61 787a4489 KangIngu
        }
62 ca16abb2 ljiyeon
63 eeb0a39c taeseongkim
        private void MainWindow_Unloaded(object sender, RoutedEventArgs e)
64
        {
65
        }
66
67 787a4489 KangIngu
        public void DialogMessage_Alert(string content, string header)
68
        {
69 c362d2a5 taeseongkim
            App.splashScreen.Close();
70
71 787a4489 KangIngu
            Telerik.Windows.Controls.DialogParameters parameters = new Telerik.Windows.Controls.DialogParameters()
72
            {
73 b9b01f8e ljiyeon
                Owner = Application.Current.MainWindow,
74 0d32593b ljiyeon
                Content = new TextBlock()
75 d33ef543 taeseongkim
                {
76 0d32593b ljiyeon
                    MinWidth = 400,
77
                    FontSize = 12,
78
                    Text = content,
79
                    TextWrapping = System.Windows.TextWrapping.Wrap
80
                },
81 787a4489 KangIngu
                Header = header,
82
                Theme = new Telerik.Windows.Controls.VisualStudio2013Theme(),
83
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
84
            };
85
            Telerik.Windows.Controls.RadWindow.Alert(parameters);
86
        }
87 7e2d29a0 ljiyeon
88 a197bf6f taeseongkim
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
89 787a4489 KangIngu
        {
90 0c997b99 ljiyeon
            InitializeComponent();
91 f44e0cd0 이지연
            //Loaded 이벤트에서 MaxHeight를 설정 모니터가 1개일때만
92
            //MaxHeight = SystemParameters.WorkArea.Height;
93
            //LocationChanged : 모니터가 2개 이상이고, 모니터의 해상도가 다를 때에 설정
94 e550eccb 이지연
            //20240610 LJY 화면 넘어갈때 이슈로 주석
95
            //this.LocationChanged += Window_LocationChanged;
96 ca16abb2 ljiyeon
            //cursor change  
97 902faaea taeseongkim
            this.Cursor = new Cursor(App.DefaultArrowCursorStream);
98 ca16abb2 ljiyeon
99 d33ef543 taeseongkim
            var point = GetScreenCenter();
100
101 c362d2a5 taeseongkim
            //this.Left = point.X;
102
            //this.Top = point.Y;
103 787a4489 KangIngu
104
            ViewerDataModel.Instance.SystemMain = this;
105
106
            if (!App.ParameterMode)
107
            {
108
                //App.ViewInfo = new IKCOM.ViewInfo
109
                //{
110
                //    DocumentItemID = "11111112",
111
                //    //DocumentItemID = "10001",
112
                //    bPartner = false,
113
                //    CreateFinalPDFPermission = true,
114
                //    NewCommentPermission = true,
115
                //    ProjectNO = "000000",
116
                //    UserID = "H2011357",
117
                //    //UserID = "H2009115",
118
                //    //Mode = 0 , 1 , 2
119
                //};
120
                //DialogMessage_Alert("데모버전은 단독 실행모드를 지원하지 않습니다", "안내");
121
122 7e2d29a0 ljiyeon
                //#if DEBUG
123
                //                App.ViewInfo = new IKCOM.ViewInfo
124
                //                {
125
                //                    DocumentItemID = "11111112",
126
                //                    //DocumentItemID = "10001",
127
                //                    bPartner = false,
128
                //                    CreateFinalPDFPermission = true,
129
                //                    NewCommentPermission = true,
130
                //                    ProjectNO = "000000",
131
                //                    UserID = "H2011357",
132
                //                    //UserID = "H2009115",
133
                //                    //Mode = 0 , 1 , 2
134
                //                };
135
                //                App.ParameterMode = true;
136
                //                this.dzMainMenu.ServiceOn();
137
                //                this.dzMainMenu.SetView(App.ViewInfo);
138
                //#else
139 787a4489 KangIngu
140
                DialogMessage_Alert("데모버전은 단독 실행모드를 지원하지 않습니다", "안내");
141
                this.dzMainMenu.pageNavigator.Visibility = Visibility.Collapsed;
142
                this.dzMainMenu.historyPane.Visibility = Visibility.Collapsed;
143
                this.dzMainMenu.infoListPane.Visibility = Visibility.Collapsed;
144
                this.dzMainMenu.searchPane.Visibility = Visibility.Collapsed;
145
                this.dzMainMenu.talkPane.Visibility = Visibility.Collapsed;
146 7e2d29a0 ljiyeon
                //#endif
147 787a4489 KangIngu
            }
148
            else
149
            {
150 43e1d368 taeseongkim
                this.dzMainMenu.talkPane.Visibility = Visibility.Collapsed;
151 787a4489 KangIngu
                this.dzMainMenu.ServiceOn();
152 992a98b4 KangIngu
153
                if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission)
154
                {
155
                    this.dzTopMenu.radRibbonView.HelpButtonVisibility = Visibility.Collapsed;
156
                    var list = this.dzTopMenu.ChildrenOfType<RadRibbonTab>().ToList();
157
                    list.ForEach(item => item.Visibility = Visibility.Collapsed);
158
                    this.dzTopMenu.ribbontab_ReadOnly.Visibility = Visibility.Visible;
159
                    this.dzTopMenu.radRibbonView.SelectedItem = this.dzTopMenu.ribbontab_ReadOnly;
160
                }
161 a197bf6f taeseongkim
                else
162
                {
163
                    string signData = await this.dzMainMenu.BaseTaskClient.GetSignDataAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID);
164
                    string signStrokes = await this.dzMainMenu.BaseTaskClient.GetSignStrokesAsync(App.ViewInfo.ProjectNO, App.ViewInfo.UserID);
165
166
                    if (signData != null && signStrokes != null)
167
                    {
168
                        MarkupToPDF.MarkupContext.SetUserSignItem(App.ViewInfo.UserID, signData, signStrokes);
169
                    }
170
                    else
171
                    {
172
                        SignManager signManager = new SignManager();
173
174
                        RadWindow signManagerPop = new RadWindow
175
                        {
176 a0d7575c taeseongkim
                            Width = 1000,
177
                            Height = 500,
178 a197bf6f taeseongkim
                            //Header = "My Check List",
179
                            Header = "",
180
                            Content = signManager,
181
                            Owner = this,
182
                            //ResizeMode = System.Windows.ResizeMode.CanResizeWithGrip,
183 a0d7575c taeseongkim
                            ResizeMode = System.Windows.ResizeMode.CanResize,
184 a197bf6f taeseongkim
                            WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen,
185 a0d7575c taeseongkim
                            CanClose =true
186 a197bf6f taeseongkim
                        };
187
                        StyleManager.SetTheme(signManagerPop, new Office2013Theme());
188
189
                        //CheckPop.ShowDialog();
190
                        signManagerPop.Show();
191
                    }
192
                }
193 3d31db34 송근호
194
                try
195
                {
196 ff01c725 humkyung
                    ///this.dzMainMenu.HubSet();
197 3d31db34 송근호
                    this.dzMainMenu.SetView(App.ViewInfo);
198
                }
199 5a6493ad humkyung
                catch (Exception ex)
200 3d31db34 송근호
                {
201 5a6493ad humkyung
                    MessageBox.Show(string.Format("웹 서비스 접속시 에러가 발생했습니다.\n{0}", ex.StackTrace));
202 3724d2a2 송근호
203
                    System.Environment.Exit(0);
204 3d31db34 송근호
                }
205 787a4489 KangIngu
            }
206
        }
207 f44e0cd0 이지연
        /// <summary>
208
        /// 멤버 변수로 현 사용자의 모든 모니터들의 상태를 가져온다.
209
        /// Window의 LocationChanged Event를 통해 Window가 이동할 때마다 어떤 모니터에 있는지를 확인
210
        /// Window가 어떤 모니터에 있는지의 기준은 각 Window의 중앙 부분 
211
        /// Sum 은 모니터들의 왼쪽 끝 부터 오른쪽 끝까지의 합
212
        /// 현재 Window의 중앙은 Left 값 + Width의 반
213
        /// um보다 작다면 현재 더하게 된 Screen 안에 있다는 뜻이므로 현재 더한 item의 WorkingArea의 Height를MaxHeight로 설정   
214
        /// </summary>
215
        System.Windows.Forms.Screen[] screens = System.Windows.Forms.Screen.AllScreens;
216
        private void Window_LocationChanged(object sender, EventArgs e) 
217 0d2d2a08 이지연
        {             
218
            int sum = 0;
219
            foreach (var item in screens)
220
            {
221
                sum += item.WorkingArea.Width;
222
                if (sum >= this.Left + this.Width / 2)
223
                {
224 f44e0cd0 이지연
                    this.MaxHeight = item.WorkingArea.Height;
225 0d2d2a08 이지연
                this.MaxWidth = item.WorkingArea.Width;
226
                if (this.Left < 0)
227
                {
228
                    this.Left = 0;
229
                }
230
231
                if (this.Top < 0)
232
                {
233
                    this.Top = 0;
234
                }
235
                //   if(this.Tag.Equals("Normal"))
236
                //{
237
                //    this.WindowState = WindowState.Normal;
238
                //    this.CustomState = WindowState.Maximized;
239
                //}    
240
                //if (this.CustomState == WindowState.Maximized)
241
                //{
242
                //    this.WindowState = WindowState.Normal;
243
                //    this.CustomState = WindowState.Normal;
244
245
246
                //}
247
                //else
248
                //{
249
                //    this.WindowState = WindowState.Normal;
250
                //    this.CustomState = WindowState.Maximized;
251
                //    this.NomalWindowArea = new Rect(this.Left, this.Top, this.Width, this.Height);
252
253
                //}                        
254
                break;
255
                }  
256 f44e0cd0 이지연
            } 
257
        }
258
        
259 d33ef543 taeseongkim
        private Point GetScreenCenter()
260 787a4489 KangIngu
        {
261 d33ef543 taeseongkim
            Point result = new Point();
262 3933072f ljiyeon
263 d33ef543 taeseongkim
            //first get all the screens 
264
            System.Drawing.Rectangle ret;
265
            int ScreenWidth = 0;
266 787a4489 KangIngu
267 d33ef543 taeseongkim
            var mousePosition = System.Windows.Forms.Cursor.Position;
268 71bfd53e ljiyeon
269 d33ef543 taeseongkim
            for (int i = 1; i <= System.Windows.Forms.Screen.AllScreens.Count(); i++)
270 71bfd53e ljiyeon
            {
271 d33ef543 taeseongkim
                ret = System.Windows.Forms.Screen.AllScreens[i - 1].Bounds;
272 3933072f ljiyeon
273 d33ef543 taeseongkim
                if (ret.Contains(mousePosition))
274
                {
275
                    result.X = ScreenWidth + (ret.Width / 2 - this.Width / 2);
276
                    result.Y = (ret.Height / 2 - this.Height / 2);
277 71bfd53e ljiyeon
278 d33ef543 taeseongkim
                    break;
279
                }
280
                else
281
                {
282
                    ScreenWidth += ret.Width;
283 71bfd53e ljiyeon
                }
284
285 d33ef543 taeseongkim
            }
286 71bfd53e ljiyeon
287
288 d33ef543 taeseongkim
            return result;
289 71bfd53e ljiyeon
        }
290
291 d33ef543 taeseongkim
        protected override void OnStateChanged(EventArgs e)
292 71bfd53e ljiyeon
        {
293 d33ef543 taeseongkim
            base.OnStateChanged(e);
294 71bfd53e ljiyeon
        }
295
296 d33ef543 taeseongkim
        protected override void OnClosing(CancelEventArgs e)
297 787a4489 KangIngu
        {
298 d33ef543 taeseongkim
            base.OnClosing(e);
299 cf1cc862 taeseongkim
            
300 bae83c92 taeseongkim
            if(!ViewerDataModel.Instance.SaveCheck())
301 75f6ff19 taeseongkim
            {
302 c362d2a5 taeseongkim
                var IsConfirm = SaveConfirm();
303
304
                if (IsConfirm == null)
305 75f6ff19 taeseongkim
                {
306
                    e.Cancel = true;
307
                }
308 c362d2a5 taeseongkim
                else if(IsConfirm == true)
309
                { 
310
                    dzTopMenu.SaveEventCallback(null, null);
311
                }
312 75f6ff19 taeseongkim
            }
313 787a4489 KangIngu
314 bae83c92 taeseongkim
            if (App.ViewInfo.CreateFinalPDFPermission)
315
            {
316
                if (!ViewerDataModel.Instance.FinalPDFCheck())
317
                {
318
                    var result = FinalConfirm();
319
320 9380813b swate0609
                    if(result == null)
321
                        e.Cancel = true;
322
323 bae83c92 taeseongkim
                    if (result == false)
324
                    {
325
                        e.Cancel = true;
326
                    }
327
                    else
328
                    {
329 6a19b48d taeseongkim
                        //Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.SaveLog(App.ViewInfo.ProjectNO, App.ViewInfo.DocumentItemID, "최종 Merged PDF 안됨.");
330 bae83c92 taeseongkim
                    }
331
                }
332
            }
333
334 d33ef543 taeseongkim
            //Update Check 를 통해 update url 을 Get 하고 결과값이 있을 경우에는 SmartUpdater 실행.
335 9d5b4bc2 taeseongkim
            //KeyValuePair<bool, string> updatecheck = UpdateCheck();
336
            //if (updatecheck.Key && !string.IsNullOrEmpty(updatecheck.Value))
337
            //{
338
            //    CallUpdateProcess(updatecheck.Value);
339
            //}
340 787a4489 KangIngu
        }
341 d33ef543 taeseongkim
342 bae83c92 taeseongkim
343
        private bool? SaveConfirm()
344 264c9309 ljiyeon
        {
345 bae83c92 taeseongkim
            bool? result = null;
346
347
            EventHandler<WindowClosedEventArgs> Closedhandler = null;
348 75f6ff19 taeseongkim
349 bae83c92 taeseongkim
            Closedhandler = (snd, evt) =>
350 32af2c3b djkim
            {
351 bae83c92 taeseongkim
                result = evt.DialogResult;
352
            };
353 264c9309 ljiyeon
354 bae83c92 taeseongkim
            DialogParameters parameters = new DialogParameters()
355
            {
356
                Content = new TextBlock()
357 32af2c3b djkim
                {
358 bae83c92 taeseongkim
                    MinWidth = 300,
359
                    FontSize = 11,
360
                    Text = "Found unsaved comments. Save now?",
361
                    TextWrapping = System.Windows.TextWrapping.Wrap
362
                },
363
364
                Header = "Confirm",
365
                Theme = new VisualStudio2013Theme(),
366
                ContentStyle = Application.Current.Resources["RadConfirmYNCStyle"] as Style,
367
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
368
369
                Owner = Application.Current.MainWindow,
370
                Opened = (s, openedEvent) =>
371 32af2c3b djkim
                {
372 bae83c92 taeseongkim
                    RadWindow confirm = s as RadWindow;
373
                    //Button Cancel = confirm.ChildrenOfType<Button>()[5];
374
                    //FocusManager.SetIsFocusScope(confirm, true);
375
                    //FocusManager.SetFocusedElement(confirm, Cancel);
376
                },
377
378
                Closed = Closedhandler
379
            };
380
381
            RadWindow.Confirm(parameters);
382 75f6ff19 taeseongkim
383
            return result;
384 264c9309 ljiyeon
        }
385 75f6ff19 taeseongkim
386 bae83c92 taeseongkim
        private bool? FinalConfirm()
387 32af2c3b djkim
        {
388 bae83c92 taeseongkim
            bool? result = false;
389 75f6ff19 taeseongkim
390
            EventHandler<WindowClosedEventArgs> Closedhandler = null;
391
392
            Closedhandler = (snd, evt) =>
393 32af2c3b djkim
            {
394 c362d2a5 taeseongkim
                result = evt.DialogResult;
395 75f6ff19 taeseongkim
            };
396
397
            DialogParameters parameters = new DialogParameters()
398
            {
399
                Content = new TextBlock()
400
                {
401 c362d2a5 taeseongkim
                    MinWidth = 300,
402 75f6ff19 taeseongkim
                    FontSize = 11,
403 bae83c92 taeseongkim
                    Text = "Merged PDF가 수행되지 않았습니다. 창을 닫으시겠습니까?",
404 75f6ff19 taeseongkim
                    TextWrapping = System.Windows.TextWrapping.Wrap
405
                },
406 c362d2a5 taeseongkim
407 75f6ff19 taeseongkim
                Header = "Confirm",
408
                Theme = new VisualStudio2013Theme(),
409 90d1dee0 swate0609
                ContentStyle = Application.Current.Resources["RadConfirmYCStyle"] as Style,
410 75f6ff19 taeseongkim
                ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
411 c362d2a5 taeseongkim
412
                Owner = Application.Current.MainWindow,
413
                Opened = (s, openedEvent) =>
414
                {
415
                    RadWindow confirm = s as RadWindow;
416
                },
417
418 75f6ff19 taeseongkim
                Closed = Closedhandler
419
            };
420
421
            RadWindow.Confirm(parameters);
422
423
            return result;
424 32af2c3b djkim
        }
425 d33ef543 taeseongkim
426 32af2c3b djkim
        private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
427
        {
428
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate
429
            {
430
                double bytesIn = double.Parse(e.BytesReceived.ToString());
431
                double totalBytes = double.Parse(e.TotalBytesToReceive.ToString());
432
                double percentage = bytesIn / totalBytes * 100;
433
                progressControl.splashText.Text = "Download : " + Math.Truncate(percentage).ToString() + " %";
434 d33ef543 taeseongkim
                progressControl.progressBar.Value = int.Parse(Math.Truncate(percentage).ToString());
435 32af2c3b djkim
            }));
436 310eff8b djkim
        }
437
438
        /// <summary>
439
        /// KCOM_API 를 통해 업데이트 URL 을 가져옴.
440
        /// false : 업데이트 불필요.
441
        /// true : 업데이트 필요. url 을 같이 Return.
442
        /// </summary>
443
        /// <returns></returns>
444
        private KeyValuePair<bool, string> UpdateCheck()
445 264c9309 ljiyeon
        {
446 310eff8b djkim
            bool isUpdateCheck = false;
447
            string updateurl = string.Empty;
448 264c9309 ljiyeon
            try
449
            {
450 ffddbe4e djkim
                bool is64bit = Environment.Is64BitProcess;
451
                string clientversion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
452
                updateurl = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVersionData(is64bit, clientversion);
453 d33ef543 taeseongkim
454 ffddbe4e djkim
                if (Check_Uri.isUri(updateurl))
455 d33ef543 taeseongkim
                {
456 32af2c3b djkim
                    DialogParameters parameters = new DialogParameters()
457 264c9309 ljiyeon
                    {
458 32af2c3b djkim
                        Owner = Application.Current.MainWindow,
459 97cde7e3 ljiyeon
                        Content = new TextBlock()
460
                        {
461
                            MinWidth = 400,
462
                            FontSize = 11,
463 eeb0a39c taeseongkim
                            Text = "Update is available. \n Update now?",
464 97cde7e3 ljiyeon
                            TextWrapping = System.Windows.TextWrapping.Wrap
465
                        },
466 32af2c3b djkim
                        Header = "Confirm",
467
                        Theme = new VisualStudio2013Theme(),
468 d33ef543 taeseongkim
                        ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
469 32af2c3b djkim
                        Closed = delegate (object windowSender, WindowClosedEventArgs e)
470 264c9309 ljiyeon
                        {
471 32af2c3b djkim
                            if (e.DialogResult == true)
472 d33ef543 taeseongkim
                            {
473
                                isUpdateCheck = true;
474 97cde7e3 ljiyeon
                            }
475
                            else
476 32af2c3b djkim
                            {
477 310eff8b djkim
                                isUpdateCheck = false;
478 d33ef543 taeseongkim
                            }
479
                        }
480 32af2c3b djkim
                    };
481 d33ef543 taeseongkim
                    RadWindow.Confirm(parameters);
482
483 264c9309 ljiyeon
                }
484
                else
485
                {
486 310eff8b djkim
                    isUpdateCheck = false;
487 264c9309 ljiyeon
                }
488
            }
489 5a6493ad humkyung
            catch (Exception ex)
490 264c9309 ljiyeon
            {
491 5a6493ad humkyung
                throw ex;
492 310eff8b djkim
            }
493
            return new KeyValuePair<bool, string>(isUpdateCheck, updateurl);
494 264c9309 ljiyeon
        }
495
496 310eff8b djkim
        /// <summary>
497
        /// SmartUpdate 를 호출.
498
        /// </summary>
499
        /// <param name="updateurl">Download 할 설치파일 경로</param>
500
        private void CallUpdateProcess(string updateurl)
501
        {
502
            ProcessStartInfo proInfo = new ProcessStartInfo();
503
            string smartupdaterpath = string.Empty;
504
            smartupdaterpath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SmartUpdate.exe");
505
            Process.Start(smartupdaterpath, updateurl);
506
        }
507 d04e8ee9 taeseongkim
        private async void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
508 32af2c3b djkim
        {
509 264c9309 ljiyeon
            try
510
            {
511 d33ef543 taeseongkim
                await Dispatcher.InvokeAsync(() => progressControl.splashText.Text = "Download Completed");
512 d04e8ee9 taeseongkim
513 d33ef543 taeseongkim
                if (progressControl != null)
514 32af2c3b djkim
                {
515
                    progressControl.Close();
516
                    progressControl = null;
517
                }
518 d33ef543 taeseongkim
                if (File.Exists(destfilepath))
519 32af2c3b djkim
                {
520
                    ProcessStartInfo update_msi = new ProcessStartInfo();
521
                    update_msi.FileName = destfilepath;
522
                    Process.Start(update_msi);
523 d33ef543 taeseongkim
                }
524 32af2c3b djkim
                this.Close();
525 264c9309 ljiyeon
            }
526 32af2c3b djkim
            catch (Exception)
527 69ef0800 KangIngu
            {
528 32af2c3b djkim
                throw;
529 69ef0800 KangIngu
            }
530 7e2d29a0 ljiyeon
531
        }
532 787a4489 KangIngu
    }
533
}
클립보드 이미지 추가 (최대 크기: 500 MB)