private void UpdateForm_Loaded(object sender, RoutedEventArgs e) { try { // get the latest version as according to the release Providers.JMMAutoUpdates.JMMVersions verInfo = Providers.JMMAutoUpdates.JMMAutoUpdatesHelper.GetLatestVersionInfo(); if (verInfo == null) { return; } } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); } }
public static Providers.JMMAutoUpdates.JMMVersions GetLatestVersionInfo() { try { // get the latest version as according to the release string uri = string.Format("http://www.jmediamanager.org/latestdownloads/versions.xml"); string xml = AniDBAPI.APIUtils.DownloadWebPage(uri); XmlSerializer x = new XmlSerializer(typeof(Providers.JMMAutoUpdates.JMMVersions)); Providers.JMMAutoUpdates.JMMVersions myTest = (Providers.JMMAutoUpdates.JMMVersions)x.Deserialize(new StringReader(xml)); ServerState.Instance.ApplicationVersionLatest = myTest.versions.ServerVersionFriendly; return(myTest); } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); return(null); } }