개정판 1c7f408a
mainWindow를 RadWindow로 변경
Change-Id: I0ac468f572b53cd39e832aed20e7d350b5c03d42
KCOM/App.xaml.cs | ||
---|---|---|
20 | 20 |
using System.Runtime.InteropServices; |
21 | 21 |
using KCOM.Views; |
22 | 22 |
using System.Threading.Tasks; |
23 |
using Telerik.Windows.Controls; |
|
23 | 24 |
|
24 | 25 |
[assembly: log4net.Config.XmlConfigurator(Watch = true)] |
25 | 26 |
namespace KCOM |
... | ... | |
134 | 135 |
try |
135 | 136 |
{ |
136 | 137 |
|
138 |
Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; |
|
137 | 139 |
|
138 | 140 |
splashScreen.Show(); |
139 | 141 |
|
... | ... | |
260 | 262 |
#endif |
261 | 263 |
|
262 | 264 |
await SplashScreenAsnyc(); |
265 |
|
|
263 | 266 |
base.OnStartup(e); |
267 |
|
|
268 |
Current.ShutdownMode = ShutdownMode.OnMainWindowClose; |
|
269 |
|
|
270 |
|
|
271 |
(new MainWindow()).Show(); |
|
272 |
//this.MainWindow.Show(); |
|
273 |
//KeyValuePair<bool, string> updatecheck = UpdateCheck(e); |
|
264 | 274 |
|
265 |
//this.MainWindow = new MainWindow(); |
|
266 | 275 |
|
267 | 276 |
} |
268 | 277 |
catch (Exception ex) |
... | ... | |
275 | 284 |
} |
276 | 285 |
} |
277 | 286 |
|
287 |
private void CallUpdateProcess(string updateurl) |
|
288 |
{ |
|
289 |
ProcessStartInfo proInfo = new ProcessStartInfo(); |
|
290 |
string smartupdaterpath = string.Empty; |
|
291 |
smartupdaterpath = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SmartUpdate.exe"); |
|
292 |
Process.Start(smartupdaterpath, updateurl); |
|
293 |
} |
|
294 |
|
|
295 |
private KeyValuePair<bool, string> UpdateCheck(StartupEventArgs startupEvents) |
|
296 |
{ |
|
297 |
bool isUpdateCheck = false; |
|
298 |
string updateurl = string.Empty; |
|
299 |
try |
|
300 |
{ |
|
301 |
bool is64bit = Environment.Is64BitProcess; |
|
302 |
string clientversion = Assembly.GetExecutingAssembly().GetName().Version.ToString(); |
|
303 |
ServiceDeepViewClient BaseClient = new ServiceDeepViewClient(_binding, _EndPoint); |
|
304 |
updateurl = BaseClient.GetVersionData(is64bit, clientversion); |
|
305 |
|
|
306 |
var result = MessageBox.Show("test","test",MessageBoxButton.OKCancel); |
|
307 |
|
|
308 |
if (result == MessageBoxResult.Cancel) |
|
309 |
{ |
|
310 |
return new KeyValuePair<bool, string>(); |
|
311 |
} |
|
312 |
|
|
313 |
if (Check_Uri.isUri(updateurl)) |
|
314 |
{ |
|
315 |
DialogParameters parameters = new DialogParameters() |
|
316 |
{ |
|
317 |
//Owner = Application.Current.MainWindow, |
|
318 |
Content = new System.Windows.Controls.TextBlock() |
|
319 |
{ |
|
320 |
MinWidth = 400, |
|
321 |
FontSize = 11, |
|
322 |
Text = "새로운 버전이 있습니다. \n업데이트 하시겠습니까?", |
|
323 |
TextWrapping = System.Windows.TextWrapping.Wrap |
|
324 |
}, |
|
325 |
Header = "Confirm", |
|
326 |
Theme = new Telerik.Windows.Controls.VisualStudio2013Theme(), |
|
327 |
ModalBackground = new System.Windows.Media.SolidColorBrush { Color = System.Windows.Media.Colors.Black, Opacity = 0.6 }, |
|
328 |
Closed = delegate (object windowSender, WindowClosedEventArgs e) |
|
329 |
{ |
|
330 |
if (e.DialogResult == true) |
|
331 |
{ |
|
332 |
CallUpdateProcess(updateurl); |
|
333 |
} |
|
334 |
|
|
335 |
base.OnStartup(startupEvents); |
|
336 |
(new MainWindow()).Show(); |
|
337 |
} |
|
338 |
}; |
|
339 |
Telerik.Windows.Controls.RadWindow.Confirm(parameters); |
|
340 |
|
|
341 |
} |
|
342 |
else |
|
343 |
{ |
|
344 |
base.OnStartup(startupEvents); |
|
345 |
(new MainWindow()).Show(); |
|
346 |
} |
|
347 |
} |
|
348 |
catch (Exception) |
|
349 |
{ |
|
350 |
throw; |
|
351 |
} |
|
352 |
return new KeyValuePair<bool, string>(isUpdateCheck, updateurl); |
|
353 |
} |
|
354 |
|
|
355 |
|
|
278 | 356 |
private async Task<bool> SplashScreenAsnyc() |
279 | 357 |
{ |
280 | 358 |
int value = 100 / ISplashMessage.SplashMessageCnt; |
내보내기 Unified diff