8
8
using NETworkManager . Localization . Resources ;
9
9
using NETworkManager . Utilities ;
10
10
using NETworkManager . Documentation ;
11
+ using NETworkManager . Properties ;
11
12
12
13
namespace NETworkManager . ViewModels
13
14
{
14
15
public class AboutViewModel : ViewModelBase
15
16
{
16
17
#region Variables
17
18
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 ) ;
19
20
20
21
private bool _isUpdateCheckRunning ;
21
22
public bool IsUpdateCheckRunning
@@ -31,16 +32,16 @@ public bool IsUpdateCheckRunning
31
32
}
32
33
}
33
34
34
- private bool _updateAvailable ;
35
- public bool UpdateAvailable
35
+ private bool _isUpdateAvailable ;
36
+ public bool IsUpdateAvailable
36
37
{
37
- get => _updateAvailable ;
38
+ get => _isUpdateAvailable ;
38
39
set
39
40
{
40
- if ( value == _updateAvailable )
41
+ if ( value == _isUpdateAvailable )
41
42
return ;
42
43
43
- _updateAvailable = value ;
44
+ _isUpdateAvailable = value ;
44
45
OnPropertyChanged ( ) ;
45
46
}
46
47
}
@@ -59,6 +60,20 @@ public string UpdateText
59
60
}
60
61
}
61
62
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
+
62
77
private bool _showUpdaterMessage ;
63
78
public bool ShowUpdaterMessage
64
79
{
@@ -186,7 +201,7 @@ private void OpenLicenseFolderAction()
186
201
#region Methods
187
202
private void CheckForUpdates ( )
188
203
{
189
- UpdateAvailable = false ;
204
+ IsUpdateAvailable = false ;
190
205
ShowUpdaterMessage = false ;
191
206
192
207
IsUpdateCheckRunning = true ;
@@ -197,17 +212,18 @@ private void CheckForUpdates()
197
212
updater . NoUpdateAvailable += Updater_NoUpdateAvailable ;
198
213
updater . Error += Updater_Error ;
199
214
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 ) ;
201
216
}
202
217
#endregion
203
218
204
219
#region Events
205
220
private void Updater_UpdateAvailable ( object sender , UpdateAvailableArgs e )
206
221
{
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 ;
208
224
209
225
IsUpdateCheckRunning = false ;
210
- UpdateAvailable = true ;
226
+ IsUpdateAvailable = true ;
211
227
}
212
228
213
229
private void Updater_NoUpdateAvailable ( object sender , EventArgs e )
0 commit comments