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 |
|
|
public partial class MainWindow : Window
|
41 |
|
|
{
|
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 |
787a4489
|
KangIngu
|
this.Loaded += MainWindow_Loaded;
|
51 |
eeb0a39c
|
taeseongkim
|
this.Unloaded += MainWindow_Unloaded;
|
52 |
91e84544
|
taeseongkim
|
this.PreviewKeyDown += new KeyEventHandler(KeyEventDownAction);
|
53 |
d97dbc7f
|
taeseongkim
|
this.Activated += MainWindow_Activated;
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
private void MainWindow_Activated(object sender, EventArgs e)
|
57 |
|
|
{
|
58 |
|
|
this.Topmost = true;
|
59 |
787a4489
|
KangIngu
|
}
|
60 |
ca16abb2
|
ljiyeon
|
|
61 |
eeb0a39c
|
taeseongkim
|
private void MainWindow_Unloaded(object sender, RoutedEventArgs e)
|
62 |
|
|
{
|
63 |
|
|
//ViewerDataModel.Instance.ImageViewPath.UriSource = null;
|
64 |
|
|
//ViewerDataModel.Instance.ImageViewPath_C.UriSource = null;
|
65 |
|
|
}
|
66 |
|
|
|
67 |
ca16abb2
|
ljiyeon
|
public static BitmapImage CursorChange()
|
68 |
|
|
{
|
69 |
|
|
BitmapImage bmp = new BitmapImage();
|
70 |
|
|
bmp.BeginInit();
|
71 |
|
|
bmp.StreamSource = System.Windows.Application.GetResourceStream(new Uri("/KCOM;Component/Resources/Cursor/customCursor2.cur", UriKind.Relative)).Stream;
|
72 |
|
|
return bmp;
|
73 |
|
|
}
|
74 |
|
|
|
75 |
787a4489
|
KangIngu
|
public void DialogMessage_Alert(string content, string header)
|
76 |
|
|
{
|
77 |
|
|
Telerik.Windows.Controls.DialogParameters parameters = new Telerik.Windows.Controls.DialogParameters()
|
78 |
|
|
{
|
79 |
b9b01f8e
|
ljiyeon
|
Owner = Application.Current.MainWindow,
|
80 |
0d32593b
|
ljiyeon
|
Content = new TextBlock()
|
81 |
d33ef543
|
taeseongkim
|
{
|
82 |
0d32593b
|
ljiyeon
|
MinWidth = 400,
|
83 |
|
|
FontSize = 12,
|
84 |
|
|
Text = content,
|
85 |
|
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
86 |
|
|
},
|
87 |
787a4489
|
KangIngu
|
Header = header,
|
88 |
|
|
Theme = new Telerik.Windows.Controls.VisualStudio2013Theme(),
|
89 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
90 |
|
|
};
|
91 |
|
|
Telerik.Windows.Controls.RadWindow.Alert(parameters);
|
92 |
|
|
}
|
93 |
7e2d29a0
|
ljiyeon
|
|
94 |
787a4489
|
KangIngu
|
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
95 |
|
|
{
|
96 |
0c997b99
|
ljiyeon
|
InitializeComponent();
|
97 |
d33ef543
|
taeseongkim
|
|
98 |
ca16abb2
|
ljiyeon
|
//cursor change
|
99 |
|
|
this.Cursor = new Cursor(CursorChange().StreamSource);
|
100 |
|
|
|
101 |
d33ef543
|
taeseongkim
|
var point = GetScreenCenter();
|
102 |
|
|
|
103 |
|
|
this.Left = point.X;
|
104 |
|
|
this.Top = point.Y;
|
105 |
787a4489
|
KangIngu
|
|
106 |
|
|
ViewerDataModel.Instance.SystemMain = this;
|
107 |
|
|
|
108 |
|
|
if (!App.ParameterMode)
|
109 |
|
|
{
|
110 |
|
|
//App.ViewInfo = new IKCOM.ViewInfo
|
111 |
|
|
//{
|
112 |
|
|
// DocumentItemID = "11111112",
|
113 |
|
|
// //DocumentItemID = "10001",
|
114 |
|
|
// bPartner = false,
|
115 |
|
|
// CreateFinalPDFPermission = true,
|
116 |
|
|
// NewCommentPermission = true,
|
117 |
|
|
// ProjectNO = "000000",
|
118 |
|
|
// UserID = "H2011357",
|
119 |
|
|
// //UserID = "H2009115",
|
120 |
|
|
// //Mode = 0 , 1 , 2
|
121 |
|
|
//};
|
122 |
|
|
//DialogMessage_Alert("데모버전은 단독 실행모드를 지원하지 않습니다", "안내");
|
123 |
|
|
|
124 |
7e2d29a0
|
ljiyeon
|
//#if DEBUG
|
125 |
|
|
// App.ViewInfo = new IKCOM.ViewInfo
|
126 |
|
|
// {
|
127 |
|
|
// DocumentItemID = "11111112",
|
128 |
|
|
// //DocumentItemID = "10001",
|
129 |
|
|
// bPartner = false,
|
130 |
|
|
// CreateFinalPDFPermission = true,
|
131 |
|
|
// NewCommentPermission = true,
|
132 |
|
|
// ProjectNO = "000000",
|
133 |
|
|
// UserID = "H2011357",
|
134 |
|
|
// //UserID = "H2009115",
|
135 |
|
|
// //Mode = 0 , 1 , 2
|
136 |
|
|
// };
|
137 |
|
|
// App.ParameterMode = true;
|
138 |
|
|
// this.dzMainMenu.ServiceOn();
|
139 |
|
|
// this.dzMainMenu.SetView(App.ViewInfo);
|
140 |
|
|
//#else
|
141 |
787a4489
|
KangIngu
|
|
142 |
|
|
DialogMessage_Alert("데모버전은 단독 실행모드를 지원하지 않습니다", "안내");
|
143 |
|
|
this.dzMainMenu.pageNavigator.Visibility = Visibility.Collapsed;
|
144 |
|
|
this.dzMainMenu.historyPane.Visibility = Visibility.Collapsed;
|
145 |
|
|
this.dzMainMenu.infoListPane.Visibility = Visibility.Collapsed;
|
146 |
|
|
this.dzMainMenu.searchPane.Visibility = Visibility.Collapsed;
|
147 |
|
|
this.dzMainMenu.talkPane.Visibility = Visibility.Collapsed;
|
148 |
7e2d29a0
|
ljiyeon
|
//#endif
|
149 |
787a4489
|
KangIngu
|
}
|
150 |
|
|
else
|
151 |
|
|
{
|
152 |
|
|
this.dzMainMenu.ServiceOn();
|
153 |
992a98b4
|
KangIngu
|
|
154 |
|
|
if (!App.ViewInfo.CreateFinalPDFPermission && !App.ViewInfo.NewCommentPermission)
|
155 |
|
|
{
|
156 |
|
|
this.dzTopMenu.radRibbonView.HelpButtonVisibility = Visibility.Collapsed;
|
157 |
|
|
var list = this.dzTopMenu.ChildrenOfType<RadRibbonTab>().ToList();
|
158 |
|
|
list.ForEach(item => item.Visibility = Visibility.Collapsed);
|
159 |
|
|
this.dzTopMenu.ribbontab_ReadOnly.Visibility = Visibility.Visible;
|
160 |
|
|
this.dzTopMenu.radRibbonView.SelectedItem = this.dzTopMenu.ribbontab_ReadOnly;
|
161 |
e0204db0
|
djkim
|
//this.dzMainMenu.SymbolPane.Visibility = Visibility.Collapsed;
|
162 |
|
|
//this.dzMainMenu.FavoritePane.Visibility = Visibility.Collapsed;
|
163 |
|
|
//this.dzMainMenu.drawingRotateCanvas.IsHitTestVisible = false;
|
164 |
992a98b4
|
KangIngu
|
}
|
165 |
3d31db34
|
송근호
|
|
166 |
|
|
try
|
167 |
|
|
{
|
168 |
ff01c725
|
humkyung
|
///this.dzMainMenu.HubSet();
|
169 |
3d31db34
|
송근호
|
this.dzMainMenu.SetView(App.ViewInfo);
|
170 |
|
|
}
|
171 |
5a6493ad
|
humkyung
|
catch (Exception ex)
|
172 |
3d31db34
|
송근호
|
{
|
173 |
5a6493ad
|
humkyung
|
MessageBox.Show(string.Format("웹 서비스 접속시 에러가 발생했습니다.\n{0}", ex.StackTrace));
|
174 |
3724d2a2
|
송근호
|
|
175 |
|
|
System.Environment.Exit(0);
|
176 |
3d31db34
|
송근호
|
}
|
177 |
787a4489
|
KangIngu
|
}
|
178 |
6707a5c7
|
ljiyeon
|
|
179 |
787a4489
|
KangIngu
|
//App.ViewInfo = new IKCOM.ViewInfo
|
180 |
|
|
//{
|
181 |
|
|
// DocumentItemID = "11111112",
|
182 |
|
|
// //DocumentItemID = "10001",
|
183 |
|
|
// bPartner = false,
|
184 |
|
|
// CreateFinalPDFPermission = true,
|
185 |
|
|
// NewCommentPermission = true,
|
186 |
|
|
// ProjectNO = "000000",
|
187 |
|
|
// UserID = "H2011357",
|
188 |
|
|
// //UserID = "H2009115",
|
189 |
|
|
// //Mode = 0 , 1 , 2
|
190 |
40a810fc
|
taeseongkim
|
//};0
|
191 |
787a4489
|
KangIngu
|
|
192 |
|
|
//this.dzMainMenu.ServiceOn();
|
193 |
|
|
//this.dzMainMenu.SetView(App.ViewInfo);
|
194 |
|
|
}
|
195 |
6707a5c7
|
ljiyeon
|
|
196 |
d33ef543
|
taeseongkim
|
private Point GetScreenCenter()
|
197 |
787a4489
|
KangIngu
|
{
|
198 |
d33ef543
|
taeseongkim
|
Point result = new Point();
|
199 |
3933072f
|
ljiyeon
|
|
200 |
d33ef543
|
taeseongkim
|
//first get all the screens
|
201 |
|
|
System.Drawing.Rectangle ret;
|
202 |
|
|
int ScreenWidth = 0;
|
203 |
787a4489
|
KangIngu
|
|
204 |
d33ef543
|
taeseongkim
|
var mousePosition = System.Windows.Forms.Cursor.Position;
|
205 |
71bfd53e
|
ljiyeon
|
|
206 |
d33ef543
|
taeseongkim
|
for (int i = 1; i <= System.Windows.Forms.Screen.AllScreens.Count(); i++)
|
207 |
71bfd53e
|
ljiyeon
|
{
|
208 |
d33ef543
|
taeseongkim
|
ret = System.Windows.Forms.Screen.AllScreens[i - 1].Bounds;
|
209 |
3933072f
|
ljiyeon
|
|
210 |
d33ef543
|
taeseongkim
|
if (ret.Contains(mousePosition))
|
211 |
|
|
{
|
212 |
|
|
result.X = ScreenWidth + (ret.Width / 2 - this.Width / 2);
|
213 |
|
|
result.Y = (ret.Height / 2 - this.Height / 2);
|
214 |
71bfd53e
|
ljiyeon
|
|
215 |
d33ef543
|
taeseongkim
|
break;
|
216 |
|
|
}
|
217 |
|
|
else
|
218 |
|
|
{
|
219 |
|
|
ScreenWidth += ret.Width;
|
220 |
71bfd53e
|
ljiyeon
|
}
|
221 |
|
|
|
222 |
d33ef543
|
taeseongkim
|
}
|
223 |
71bfd53e
|
ljiyeon
|
|
224 |
|
|
|
225 |
d33ef543
|
taeseongkim
|
return result;
|
226 |
71bfd53e
|
ljiyeon
|
}
|
227 |
|
|
|
228 |
d33ef543
|
taeseongkim
|
protected override void OnStateChanged(EventArgs e)
|
229 |
71bfd53e
|
ljiyeon
|
{
|
230 |
d33ef543
|
taeseongkim
|
base.OnStateChanged(e);
|
231 |
71bfd53e
|
ljiyeon
|
}
|
232 |
|
|
|
233 |
d33ef543
|
taeseongkim
|
protected override void OnClosing(CancelEventArgs e)
|
234 |
787a4489
|
KangIngu
|
{
|
235 |
d33ef543
|
taeseongkim
|
base.OnClosing(e);
|
236 |
787a4489
|
KangIngu
|
|
237 |
d33ef543
|
taeseongkim
|
SaveCheck();
|
238 |
787a4489
|
KangIngu
|
|
239 |
d33ef543
|
taeseongkim
|
//Update Check 를 통해 update url 을 Get 하고 결과값이 있을 경우에는 SmartUpdater 실행.
|
240 |
|
|
KeyValuePair<bool, string> updatecheck = UpdateCheck();
|
241 |
|
|
if (updatecheck.Key && !string.IsNullOrEmpty(updatecheck.Value))
|
242 |
787a4489
|
KangIngu
|
{
|
243 |
d33ef543
|
taeseongkim
|
CallUpdateProcess(updatecheck.Value);
|
244 |
787a4489
|
KangIngu
|
}
|
245 |
|
|
}
|
246 |
d33ef543
|
taeseongkim
|
|
247 |
32af2c3b
|
djkim
|
private void SaveCheck()
|
248 |
264c9309
|
ljiyeon
|
{
|
249 |
32af2c3b
|
djkim
|
if (ViewerDataModel.Instance.UndoDataList.Count > 0)
|
250 |
|
|
{
|
251 |
|
|
DateTime undoTime = ViewerDataModel.Instance.UndoDataList.OrderByDescending(order => order.EventTime).FirstOrDefault().EventTime;
|
252 |
|
|
DateTime updatetime = DateTime.Now.AddDays(-1);
|
253 |
|
|
if (ViewerDataModel.Instance._markupInfoList.Count > 0)
|
254 |
|
|
{
|
255 |
|
|
updatetime = ViewerDataModel.Instance._markupInfoList.OrderByDescending(order => order.UpdateTime).FirstOrDefault().UpdateTime;
|
256 |
|
|
}
|
257 |
264c9309
|
ljiyeon
|
|
258 |
32af2c3b
|
djkim
|
if (undoTime > updatetime)
|
259 |
|
|
{
|
260 |
|
|
DialogParameters parameters = new DialogParameters()
|
261 |
|
|
{
|
262 |
|
|
Owner = Application.Current.MainWindow,
|
263 |
0d32593b
|
ljiyeon
|
Content = new TextBlock()
|
264 |
|
|
{
|
265 |
|
|
MinWidth = 400,
|
266 |
|
|
FontSize = 11,
|
267 |
eeb0a39c
|
taeseongkim
|
Text = "Found unsaved comments. Save now?",
|
268 |
0d32593b
|
ljiyeon
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
269 |
|
|
},
|
270 |
32af2c3b
|
djkim
|
Header = "Confirm",
|
271 |
|
|
Theme = new VisualStudio2013Theme(),
|
272 |
|
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
273 |
|
|
Closed = OnClosingSave,
|
274 |
|
|
};
|
275 |
|
|
RadWindow.Confirm(parameters);
|
276 |
|
|
}
|
277 |
|
|
else
|
278 |
|
|
{
|
279 |
|
|
isSaveCheck = true;
|
280 |
d33ef543
|
taeseongkim
|
}
|
281 |
|
|
}
|
282 |
|
|
else
|
283 |
264c9309
|
ljiyeon
|
{
|
284 |
32af2c3b
|
djkim
|
isSaveCheck = true;
|
285 |
264c9309
|
ljiyeon
|
}
|
286 |
|
|
}
|
287 |
32af2c3b
|
djkim
|
private void OnClosingSave(object sender, WindowClosedEventArgs e)
|
288 |
|
|
{
|
289 |
|
|
if (e.DialogResult == true)
|
290 |
|
|
{
|
291 |
|
|
dzTopMenu.SaveEventCallback(null, null);
|
292 |
|
|
}
|
293 |
|
|
isSaveCheck = true;
|
294 |
|
|
}
|
295 |
d33ef543
|
taeseongkim
|
|
296 |
32af2c3b
|
djkim
|
private void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
|
297 |
|
|
{
|
298 |
|
|
Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(delegate
|
299 |
|
|
{
|
300 |
|
|
double bytesIn = double.Parse(e.BytesReceived.ToString());
|
301 |
|
|
double totalBytes = double.Parse(e.TotalBytesToReceive.ToString());
|
302 |
|
|
double percentage = bytesIn / totalBytes * 100;
|
303 |
|
|
progressControl.splashText.Text = "Download : " + Math.Truncate(percentage).ToString() + " %";
|
304 |
d33ef543
|
taeseongkim
|
progressControl.progressBar.Value = int.Parse(Math.Truncate(percentage).ToString());
|
305 |
32af2c3b
|
djkim
|
}));
|
306 |
310eff8b
|
djkim
|
}
|
307 |
|
|
|
308 |
|
|
/// <summary>
|
309 |
|
|
/// KCOM_API 를 통해 업데이트 URL 을 가져옴.
|
310 |
|
|
/// false : 업데이트 불필요.
|
311 |
|
|
/// true : 업데이트 필요. url 을 같이 Return.
|
312 |
|
|
/// </summary>
|
313 |
|
|
/// <returns></returns>
|
314 |
|
|
private KeyValuePair<bool, string> UpdateCheck()
|
315 |
264c9309
|
ljiyeon
|
{
|
316 |
310eff8b
|
djkim
|
bool isUpdateCheck = false;
|
317 |
|
|
string updateurl = string.Empty;
|
318 |
264c9309
|
ljiyeon
|
try
|
319 |
|
|
{
|
320 |
ffddbe4e
|
djkim
|
bool is64bit = Environment.Is64BitProcess;
|
321 |
|
|
string clientversion = Assembly.GetExecutingAssembly().GetName().Version.ToString();
|
322 |
|
|
updateurl = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.BaseClient.GetVersionData(is64bit, clientversion);
|
323 |
d33ef543
|
taeseongkim
|
|
324 |
ffddbe4e
|
djkim
|
if (Check_Uri.isUri(updateurl))
|
325 |
d33ef543
|
taeseongkim
|
{
|
326 |
32af2c3b
|
djkim
|
DialogParameters parameters = new DialogParameters()
|
327 |
264c9309
|
ljiyeon
|
{
|
328 |
32af2c3b
|
djkim
|
Owner = Application.Current.MainWindow,
|
329 |
97cde7e3
|
ljiyeon
|
Content = new TextBlock()
|
330 |
|
|
{
|
331 |
|
|
MinWidth = 400,
|
332 |
|
|
FontSize = 11,
|
333 |
eeb0a39c
|
taeseongkim
|
Text = "Update is available. \n Update now?",
|
334 |
97cde7e3
|
ljiyeon
|
TextWrapping = System.Windows.TextWrapping.Wrap
|
335 |
|
|
},
|
336 |
32af2c3b
|
djkim
|
Header = "Confirm",
|
337 |
|
|
Theme = new VisualStudio2013Theme(),
|
338 |
d33ef543
|
taeseongkim
|
ModalBackground = new SolidColorBrush { Color = Colors.Black, Opacity = 0.6 },
|
339 |
32af2c3b
|
djkim
|
Closed = delegate (object windowSender, WindowClosedEventArgs e)
|
340 |
264c9309
|
ljiyeon
|
{
|
341 |
32af2c3b
|
djkim
|
if (e.DialogResult == true)
|
342 |
d33ef543
|
taeseongkim
|
{
|
343 |
|
|
isUpdateCheck = true;
|
344 |
97cde7e3
|
ljiyeon
|
}
|
345 |
|
|
else
|
346 |
32af2c3b
|
djkim
|
{
|
347 |
310eff8b
|
djkim
|
isUpdateCheck = false;
|
348 |
d33ef543
|
taeseongkim
|
}
|
349 |
|
|
}
|
350 |
32af2c3b
|
djkim
|
};
|
351 |
d33ef543
|
taeseongkim
|
RadWindow.Confirm(parameters);
|
352 |
|
|
|
353 |
264c9309
|
ljiyeon
|
}
|
354 |
|
|
else
|
355 |
|
|
{
|
356 |
310eff8b
|
djkim
|
isUpdateCheck = false;
|
357 |
264c9309
|
ljiyeon
|
}
|
358 |
|
|
}
|
359 |
5a6493ad
|
humkyung
|
catch (Exception ex)
|
360 |
264c9309
|
ljiyeon
|
{
|
361 |
5a6493ad
|
humkyung
|
throw ex;
|
362 |
310eff8b
|
djkim
|
}
|
363 |
|
|
return new KeyValuePair<bool, string>(isUpdateCheck, updateurl);
|
364 |
264c9309
|
ljiyeon
|
}
|
365 |
|
|
|
366 |
310eff8b
|
djkim
|
/// <summary>
|
367 |
|
|
/// SmartUpdate 를 호출.
|
368 |
|
|
/// </summary>
|
369 |
|
|
/// <param name="updateurl">Download 할 설치파일 경로</param>
|
370 |
|
|
private void CallUpdateProcess(string updateurl)
|
371 |
|
|
{
|
372 |
|
|
ProcessStartInfo proInfo = new ProcessStartInfo();
|
373 |
|
|
string smartupdaterpath = string.Empty;
|
374 |
|
|
smartupdaterpath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SmartUpdate.exe");
|
375 |
|
|
Process.Start(smartupdaterpath, updateurl);
|
376 |
|
|
}
|
377 |
d04e8ee9
|
taeseongkim
|
private async void Client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
378 |
32af2c3b
|
djkim
|
{
|
379 |
264c9309
|
ljiyeon
|
try
|
380 |
|
|
{
|
381 |
d33ef543
|
taeseongkim
|
await Dispatcher.InvokeAsync(() => progressControl.splashText.Text = "Download Completed");
|
382 |
d04e8ee9
|
taeseongkim
|
|
383 |
d33ef543
|
taeseongkim
|
if (progressControl != null)
|
384 |
32af2c3b
|
djkim
|
{
|
385 |
|
|
progressControl.Close();
|
386 |
|
|
progressControl = null;
|
387 |
|
|
}
|
388 |
d33ef543
|
taeseongkim
|
if (File.Exists(destfilepath))
|
389 |
32af2c3b
|
djkim
|
{
|
390 |
|
|
ProcessStartInfo update_msi = new ProcessStartInfo();
|
391 |
|
|
update_msi.FileName = destfilepath;
|
392 |
|
|
Process.Start(update_msi);
|
393 |
d33ef543
|
taeseongkim
|
}
|
394 |
32af2c3b
|
djkim
|
this.Close();
|
395 |
264c9309
|
ljiyeon
|
}
|
396 |
32af2c3b
|
djkim
|
catch (Exception)
|
397 |
69ef0800
|
KangIngu
|
{
|
398 |
32af2c3b
|
djkim
|
throw;
|
399 |
69ef0800
|
KangIngu
|
}
|
400 |
7e2d29a0
|
ljiyeon
|
|
401 |
|
|
}
|
402 |
787a4489
|
KangIngu
|
}
|
403 |
|
|
} |