@@ -45,7 +45,23 @@ public UpdateManager(Version version, string updateUrl, StringVariables stringVa
45
45
_applicationVersion = new Version ( version . Major , version . Minor , version . Build , version . Revision ) ;
46
46
47
47
_update . SetApplicationVersion ( _applicationVersion ) ;
48
- _stringVariables = stringVariables ;
48
+ SetStringVariables ( stringVariables ) ;
49
+ }
50
+
51
+ /// <summary>
52
+ /// Initialize a new UpdateManager object
53
+ /// </summary>
54
+ /// <param name="version">Your application version</param>
55
+ /// <param name="updateUrl">The URL where your XML update file is located</param>
56
+ public UpdateManager ( Version version , string updateUrl )
57
+ {
58
+ _updateUrl = updateUrl ;
59
+
60
+ _update = new Update ( ) ;
61
+ _applicationVersion = new Version ( version . Major , version . Minor , version . Build , version . Revision ) ;
62
+
63
+ _update . SetApplicationVersion ( _applicationVersion ) ;
64
+ SetStringVariables ( new StringVariables ( ) ) ;
49
65
}
50
66
51
67
/// <summary>
@@ -57,8 +73,7 @@ public async void CheckForUpdate(bool showErrors, bool showNoUpdates)
57
73
{
58
74
try
59
75
{
60
- WebClient wc = new WebClient ( ) ;
61
- string xml = await wc . DownloadStringTaskAsync ( _updateUrl ) ;
76
+ string xml = await new WebClient ( ) . DownloadStringTaskAsync ( _updateUrl ) ;
62
77
63
78
XmlSerializer serializer = new XmlSerializer ( _update . GetType ( ) ) ;
64
79
using ( MemoryStream stream = new MemoryStream ( ) )
0 commit comments