public static UpdateFile FindUpdates() { var file = new UpdateFile(); var client = new WebClient(); using (var reader = XmlReader.Create("http://willeddins.com/apps/commercial-sc2/updates.xml")) { while (reader.Read()) { if (reader.IsStartElement()) { switch (reader.Name) { case "Version": reader.Read(); var content = reader.Value; file.Version = Version.Parse(content); break; case "DownloadLocation": reader.Read(); file.DownloadLocation = new Uri(reader.Value); break; } } } } file.IsNewerVersion = Assembly.GetEntryAssembly().GetName().Version < file.Version; return file; }
private void CheckForUpdates() { this.updates = UpdateFile.FindUpdates(); if (this.updates.IsNewerVersion) { this.Dispatcher.BeginInvoke((Action)delegate { btnUpdate.Visibility = Visibility.Visible; }); } }
public UpdateControl(UpdateFile update) : this() { this.updates = update; }