25 lines
623 B
C#
25 lines
623 B
C#
using System.IO;
|
|
|
|
namespace Pilz.Updating.Administration;
|
|
|
|
public class UpdateServerManager(UpdateServerConfig config)
|
|
{
|
|
public UpdateInfo UpdateInfo { get; internal set; } = new();
|
|
public UpdateServerConfig Config { get; private set; } = config;
|
|
public bool IsReady { get; private set; }
|
|
|
|
public void LoadInfoFromFile(string filePath)
|
|
{
|
|
UpdateInfo = UpdateInfo.Parse(File.ReadAllText(filePath));
|
|
}
|
|
|
|
public void SaveInfoToFile(string filePath)
|
|
{
|
|
File.WriteAllText(filePath, UpdateInfo.ToString());
|
|
}
|
|
|
|
public void NewInfo()
|
|
{
|
|
UpdateInfo = new();
|
|
}
|
|
} |