From ea33a8d948dcc0f451f449496121d5ed67623745 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sat, 11 Apr 2020 09:52:25 -0500 Subject: [PATCH] Moved some fields to view model --- DS4Windows/DS4Forms/MainWindow.xaml.cs | 7 ++----- DS4Windows/DS4Forms/ViewModels/MainWindowsViewModel.cs | 3 +++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index 957f34a..4b6fdca 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -55,9 +55,6 @@ namespace DS4WinWPF.DS4Forms public ProfileList ProfileListHolder { get => profileListHolder; } - private const string UPDATER_VERSION = "1.4.1"; - private string updaterExe = Environment.Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe"; - public MainWindow(ArgumentParser parser) { InitializeComponent(); @@ -190,9 +187,9 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question bool launch = true; if (!File.Exists(Global.exedirpath + "\\DS4Updater.exe") || (File.Exists(Global.exedirpath + "\\DS4Updater.exe") - && (FileVersionInfo.GetVersionInfo(Global.exedirpath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0))) + && (FileVersionInfo.GetVersionInfo(Global.exedirpath + "\\DS4Updater.exe").FileVersion.CompareTo(MainWindowsViewModel.UPDATER_VERSION) != 0))) { - Uri url2 = new Uri($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}"); + Uri url2 = new Uri($"https://github.com/Ryochan7/DS4Updater/releases/download/v{MainWindowsViewModel.UPDATER_VERSION}/{mainWinVM.updaterExe}"); string filename = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "DS4Updater.exe"); using (var downloadStream = new FileStream(filename, FileMode.Create)) { diff --git a/DS4Windows/DS4Forms/ViewModels/MainWindowsViewModel.cs b/DS4Windows/DS4Forms/ViewModels/MainWindowsViewModel.cs index 89a36be..06c5457 100644 --- a/DS4Windows/DS4Forms/ViewModels/MainWindowsViewModel.cs +++ b/DS4Windows/DS4Forms/ViewModels/MainWindowsViewModel.cs @@ -20,5 +20,8 @@ namespace DS4WinWPF.DS4Forms.ViewModels } } public event EventHandler FullTabsEnabledChanged; + + public const string UPDATER_VERSION = "1.4.1"; + public string updaterExe = Environment.Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe"; } }