using BS.SharedLauncher.Enums; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml; namespace BeWo.Service.ServiceUtils.Update { public class UpdateConfigHelper { public XmlDocument Document{ get; set; } public string Tenant { get; set; } public UpdateConfigHelper(string configFile, string tenant) { Document = new XmlDocument(); Document.Load(configFile); Tenant = tenant; } //public PlanerUpdateSource Source => GotSpecialVersion ? PlanerUpdateSource.SpecialVersion : PlanerUpdateSource.NewestVersion; public string LoadSpecificVersion() { try { return Document.SelectSingleNode($"/config/tenant[@id='{Tenant}']/version").InnerXml; } catch (Exception) { return null; } } public string LoadDefaultVersion() { return Document.SelectSingleNode("/config/default/version").InnerXml; } } }