개정판 cf2671a6
issue #681 스플래시 스크린
Change-Id: I9db43999dbef9f30d36e84a864f243285a253393
KCOM/App.xaml.cs | ||
---|---|---|
18 | 18 |
using log4net; |
19 | 19 |
using System.Text; |
20 | 20 |
using System.Runtime.InteropServices; |
21 |
using KCOM.Views; |
|
22 |
using System.Threading.Tasks; |
|
21 | 23 |
|
22 | 24 |
[assembly: log4net.Config.XmlConfigurator(Watch = true)] |
23 | 25 |
namespace KCOM |
... | ... | |
86 | 88 |
} |
87 | 89 |
|
88 | 90 |
private string versionPath = null; |
89 |
public SplashScreen splash = new SplashScreen("splash.png"); |
|
90 |
|
|
91 |
//public SplashScreen splash = new SplashScreen("splash.png");
|
|
92 |
public SplashScreenWindow splashScreen = new SplashScreenWindow(); |
|
91 | 93 |
protected override void OnStartup(StartupEventArgs e) |
92 |
{ |
|
94 |
{
|
|
93 | 95 |
try |
94 | 96 |
{ |
97 |
splashScreen.Show(); |
|
98 |
|
|
95 | 99 |
/// create log database and table |
96 | 100 |
using (IAbstractDatabase database = new AppSQLiteDatabase() { FilePath = Path.Combine(AppDataFolder, "log4net.db") }) |
97 | 101 |
{ |
... | ... | |
105 | 109 |
App.DBLogger = LogManager.GetLogger("DBLogger"); |
106 | 110 |
App.FileLogger = LogManager.GetLogger("EventLogger"); |
107 | 111 |
|
108 |
splash.Show(false, false);
|
|
109 |
|
|
112 |
//splash.Show(false, false);
|
|
113 |
|
|
110 | 114 |
if (e.Args.Count() > 0) |
111 | 115 |
{ |
112 | 116 |
var result = ParamDecoding(e.Args[0].Replace(@"kcom://", "").Replace(@"/", "")); |
... | ... | |
229 | 233 |
} |
230 | 234 |
} |
231 | 235 |
else |
232 |
{ |
|
233 |
base.OnStartup(e); |
|
234 |
splash.Close(new TimeSpan(0, 0, 2)); |
|
236 |
{ |
|
237 |
// splash.Close(new TimeSpan(0, 0, 2)); |
|
238 |
Task.Factory.StartNew(() => |
|
239 |
{ |
|
240 |
for (int i = 1; i <= 100; i++) |
|
241 |
{ |
|
242 |
System.Threading.Thread.Sleep(1); |
|
243 |
splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i); |
|
244 |
} |
|
245 |
this.Dispatcher.Invoke(() => |
|
246 |
{ |
|
247 |
base.OnStartup(e); |
|
248 |
splashScreen.Close(); |
|
249 |
}); |
|
250 |
|
|
251 |
}); |
|
235 | 252 |
} |
236 | 253 |
} |
237 | 254 |
catch (Exception ex) //2. 파일이 없거나 파일내에 version의 값이 없다면 KCOM 실행하기 |
238 | 255 |
{ |
239 | 256 |
ErrorLogFileWrite("KCOM//UpdateCheck ERR : " + ex); |
240 |
base.OnStartup(e); |
|
241 |
splash.Close(new TimeSpan(0, 0, 2)); |
|
242 |
} |
|
257 |
|
|
258 |
Task.Factory.StartNew(() => |
|
259 |
{ |
|
260 |
for (int i = 1; i <= 100; i++) |
|
261 |
{ |
|
262 |
System.Threading.Thread.Sleep(1); |
|
263 |
splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i); |
|
264 |
} |
|
265 |
this.Dispatcher.Invoke(() => |
|
266 |
{ |
|
267 |
base.OnStartup(e); |
|
268 |
splashScreen.Close(); |
|
269 |
}); |
|
270 |
}); |
|
271 |
} |
|
243 | 272 |
} |
244 | 273 |
} |
245 | 274 |
catch (Exception ex) |
... | ... | |
248 | 277 |
} |
249 | 278 |
finally |
250 | 279 |
{ |
251 |
splash.Close(new TimeSpan(0, 0, 2)); |
|
280 |
Task.Factory.StartNew(() => |
|
281 |
{ |
|
282 |
for (int i = 1; i <= 100; i++) |
|
283 |
{ |
|
284 |
System.Threading.Thread.Sleep(1); |
|
285 |
splashScreen.Dispatcher.Invoke(() => splashScreen.Progress = i); |
|
286 |
} |
|
287 |
this.Dispatcher.Invoke(() => |
|
288 |
{ |
|
289 |
//base.OnStartup(e); |
|
290 |
splashScreen.Close(); |
|
291 |
}); |
|
292 |
}); |
|
252 | 293 |
} |
294 |
|
|
253 | 295 |
} |
254 | 296 |
|
255 | 297 |
/// <summary> |
내보내기 Unified diff