44 lines
1.1 KiB
C#
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 UpdateConfigReader
|
|
{
|
|
private XmlDocument Document{ get; set; }
|
|
private string Tenant { get; set; }
|
|
|
|
public UpdateConfigReader(string configFilePath, string tenant)
|
|
{
|
|
Document = new XmlDocument();
|
|
Document.Load(configFilePath);
|
|
|
|
Tenant = tenant;
|
|
}
|
|
|
|
//public PlanerUpdateSource Source => GotSpecialVersion ? PlanerUpdateSource.SpecialVersion : PlanerUpdateSource.NewestVersion;
|
|
|
|
public string GetSpecificVersion()
|
|
{
|
|
try
|
|
{
|
|
return Document.SelectSingleNode($"/config/versions/tenant[@id='{Tenant}']/version")?.InnerXml;
|
|
}
|
|
catch (Exception)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public string GetDefaultVersion()
|
|
{
|
|
return Document.SelectSingleNode("/config/default/version").InnerXml;
|
|
}
|
|
}
|
|
}
|