88using NETworkManager . Localization . Resources ;
99using NETworkManager . Utilities ;
1010using NETworkManager . Documentation ;
11+ using NETworkManager . Properties ;
1112
1213namespace NETworkManager . ViewModels
1314{
1415 public class AboutViewModel : ViewModelBase
1516 {
1617 #region Variables
1718 public string Version => $ "{ Strings . Version } { AssemblyManager . Current . Version } ";
18- public string DevelopedByText => string . Format ( Strings . DevelopedAndMaintainedByX + " " , Properties . Resources . NETworkManager_GitHub_User ) ;
19+ public string DevelopedByText => string . Format ( Strings . DevelopedAndMaintainedByX + " " , Resources . NETworkManager_GitHub_User ) ;
1920
2021 private bool _isUpdateCheckRunning ;
2122 public bool IsUpdateCheckRunning
@@ -31,16 +32,16 @@ public bool IsUpdateCheckRunning
3132 }
3233 }
3334
34- private bool _updateAvailable ;
35- public bool UpdateAvailable
35+ private bool _isUpdateAvailable ;
36+ public bool IsUpdateAvailable
3637 {
37- get => _updateAvailable ;
38+ get => _isUpdateAvailable ;
3839 set
3940 {
40- if ( value == _updateAvailable )
41+ if ( value == _isUpdateAvailable )
4142 return ;
4243
43- _updateAvailable = value ;
44+ _isUpdateAvailable = value ;
4445 OnPropertyChanged ( ) ;
4546 }
4647 }
@@ -59,6 +60,20 @@ public string UpdateText
5960 }
6061 }
6162
63+ private string _updateReleaseUrl ;
64+ public string UpdateReleaseUrl
65+ {
66+ get => _updateReleaseUrl ;
67+ set
68+ {
69+ if ( value == _updateReleaseUrl )
70+ return ;
71+
72+ _updateReleaseUrl = value ;
73+ OnPropertyChanged ( ) ;
74+ }
75+ }
76+
6277 private bool _showUpdaterMessage ;
6378 public bool ShowUpdaterMessage
6479 {
@@ -186,7 +201,7 @@ private void OpenLicenseFolderAction()
186201 #region Methods
187202 private void CheckForUpdates ( )
188203 {
189- UpdateAvailable = false ;
204+ IsUpdateAvailable = false ;
190205 ShowUpdaterMessage = false ;
191206
192207 IsUpdateCheckRunning = true ;
@@ -197,17 +212,18 @@ private void CheckForUpdates()
197212 updater . NoUpdateAvailable += Updater_NoUpdateAvailable ;
198213 updater . Error += Updater_Error ;
199214
200- updater . CheckOnGitHub ( Properties . Resources . NETworkManager_GitHub_User , Properties . Resources . NETworkManager_GitHub_Repo , AssemblyManager . Current . Version ) ;
215+ updater . CheckOnGitHub ( Resources . NETworkManager_GitHub_User , Resources . NETworkManager_GitHub_Repo , AssemblyManager . Current . Version , SettingsManager . Current . Update_CheckForPreReleases ) ;
201216 }
202217 #endregion
203218
204219 #region Events
205220 private void Updater_UpdateAvailable ( object sender , UpdateAvailableArgs e )
206221 {
207- UpdateText = string . Format ( Strings . VersionxxIsAvailable , e . Version ) ;
222+ UpdateText = string . Format ( Strings . VersionxxIsAvailable , e . Release . TagName ) ;
223+ UpdateReleaseUrl = e . Release . Prerelease ? e . Release . HtmlUrl : Resources . NETworkManager_LatestReleaseUrl ;
208224
209225 IsUpdateCheckRunning = false ;
210- UpdateAvailable = true ;
226+ IsUpdateAvailable = true ;
211227 }
212228
213229 private void Updater_NoUpdateAvailable ( object sender , EventArgs e )
0 commit comments