blob: df4a9c8e2709eb4fb797135866d2d37591a09881 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core;
using Tango.Core.Helpers;
using Tango.PPC.Common;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Common.Notifications;
using Tango.SharedUI;
namespace Tango.PPC.UI.ViewModels
{
public class LoadingViewVM : PPCViewModel
{
public LoadingViewVM(IPPCApplicationManager application, IAuthenticationProvider authentication, INavigationManager navigation, INotificationProvider notification) : base(application, authentication, navigation, notification)
{
}
public async override void OnApplicationStarted()
{
await Task.Delay(500);
//TODO: Use this in the future.
//#if DEBUG
// DataSource = "localhost\\SQLEXPRESS";
//#else
// DataBaseSettings.DefaultDataSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
//#endif
CoreSettings.DefaultDataBaseSource = Path.Combine(PathHelper.GetUserTangoFolder(), "DB", "Tango.db");
if (!File.Exists(CoreSettings.DefaultDataBaseSource))
{
Directory.CreateDirectory(Path.GetDirectoryName(CoreSettings.DefaultDataBaseSource));
File.Copy(Path.Combine(PathHelper.GetStartupPath(), "DB", "Tango.db"), CoreSettings.DefaultDataBaseSource);
}
NavigationManager.NavigateTo(NavigationView.LayoutView);
NavigationManager.NavigateTo(NavigationView.JobsView);
}
}
}
|