diff options
| author | Avi Levkovich <avi@twine-s.com> | 2018-06-03 10:34:59 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2018-06-03 10:34:59 +0300 |
| commit | 34b3f33ec9ccb682c430b3c9e206507d0a396e1c (patch) | |
| tree | 4d67c5f052c5583283f5c7ce02ad77fab8a875c6 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | |
| parent | 565d4cfcfc382e1ab63fd8fc6bbb3bb4562d16d9 (diff) | |
| parent | 7399e15a1456064fc2e25daf841e0d3027d83489 (diff) | |
| download | Tango-34b3f33ec9ccb682c430b3c9e206507d0a396e1c.tar.gz Tango-34b3f33ec9ccb682c430b3c9e206507d0a396e1c.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs index 4cc812a17..df4a9c8e2 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs @@ -1,8 +1,11 @@ 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; @@ -21,7 +24,24 @@ namespace Tango.PPC.UI.ViewModels public async override void OnApplicationStarted() { - await Task.Delay(2000); + 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); } |
