Zwischenstand:
- Download Req und Res eingeführt - Version XML + version.config
This commit is contained in:
43
Service/ServiceUtils/Update/UpdateConfigHelper.cs
Normal file
43
Service/ServiceUtils/Update/UpdateConfigHelper.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user