public static void TryCheckForUpdates() { s_lastInstallCheckDate = new LastCheckDate(kPrefsKeyLastUpdateCheckDate); if (s_lastInstallCheckDate.CanCheckNow()) { s_lastInstallCheckDate.SetToday(); CheckForUpdates(); } else { Log.d("Skipping update check. Next check: {0}", s_lastInstallCheckDate); } }
#pragma warning restore 0649 public static void TryCheckForUpdates() { #if !LUNAR_CONSOLE_UPDATER_DISABLED s_lastInstallCheckDate = new LastCheckDate(kPrefsKeyLastUpdateCheckDate); if (s_lastInstallCheckDate.CanCheckNow()) { s_lastInstallCheckDate.SetToday(); CheckForUpdates(); } else { Log.d("Skipping update check. Next check: {0}", s_lastInstallCheckDate); } #endif }
/// <summary> /// Save this catalog to a file for the next time where WPP start. /// </summary> internal void Save(string baseFolder) { Logger.EnteringMethod(baseFolder); System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument(); System.Xml.XmlElement rootElement = (System.Xml.XmlElement)xmlDoc.AppendChild(xmlDoc.CreateElement("CatalogSubscription")); rootElement.AppendChild(xmlDoc.CreateElement("IsActive")).InnerText = IsActive.ToString(); rootElement.AppendChild(xmlDoc.CreateElement("Address")).InnerText = Address; rootElement.AppendChild(xmlDoc.CreateElement("CheckEvery")).InnerText = CheckEvery.ToString(); rootElement.AppendChild(xmlDoc.CreateElement("Unit")).InnerText = Unit.ToString(); rootElement.AppendChild(xmlDoc.CreateElement("LastCheck")).InnerText = LastCheckDate.ToString(); rootElement.AppendChild(xmlDoc.CreateElement("LastCheckResult")).InnerText = LastCheckResult.ToString(); rootElement.AppendChild(xmlDoc.CreateElement("CatalogName")).InnerText = CatalogName; rootElement.AppendChild(xmlDoc.CreateElement("Hash")).InnerText = Hash; rootElement.AppendChild(xmlDoc.CreateElement("LastDownloadDate")).InnerText = LastDownloadDate.ToString(); FileInfo catalogFile = new FileInfo(baseFolder + "\\" + this.CatalogName + ".xml"); if (!catalogFile.Directory.Exists) { catalogFile.Directory.Create(); } try { xmlDoc.Save(catalogFile.FullName); } catch (Exception ex) { Logger.Write("**** Error when saving " + catalogFile.FullName + ".\r\n" + ex.Message); } }