diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-31 17:46:58 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-05-31 17:46:58 +0300 |
| commit | 80ee37a6dee6a3c4dcf579593c4ce7a914cbf6c9 (patch) | |
| tree | bd38866d7a5c59139657b39e7a06fda4ef8d87e1 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LoadingViewVM.cs | |
| parent | 4c52212365cd31f2490e1b9d892b8d4cd9904d09 (diff) | |
| parent | 34f3c0b2ee181cf7f43672a0f5b4509265a817ea (diff) | |
| download | Tango-80ee37a6dee6a3c4dcf579593c4ce7a914cbf6c9.tar.gz Tango-80ee37a6dee6a3c4dcf579593c4ce7a914cbf6c9.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 | 20 |
1 files changed, 20 insertions, 0 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 5373539f2..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; @@ -22,6 +25,23 @@ namespace Tango.PPC.UI.ViewModels 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); } |
