Files
BeWoPlaner/Service/ServiceUtils/Update/UpdateConfigHelper.cs
rene 25438ebd2d Zwischenstand:
- Download Req und Res eingeführt
- Version XML + version.config
2022-03-09 16:29:00 +01:00

44 lines
1.1 KiB
C#

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;
}
}
}