27 lines
756 B
C#
27 lines
756 B
C#
using Newtonsoft.Json;
|
|
using Pilz.Updating.Administration.Discord;
|
|
using Pilz.Updating.Administration.Integrations;
|
|
using System.IO;
|
|
|
|
namespace Pilz.Updating.Administration;
|
|
|
|
public class UpdateProject
|
|
{
|
|
public UpdateServerConfig UpdateServerConfig { get; } = new();
|
|
public DiscordBotConfig DiscordBotConfig { get; } = new();
|
|
public ProxyConfiguration ProxyConfig { get; } = new();
|
|
|
|
public static UpdateProject Load(string filePath)
|
|
{
|
|
if (File.Exists(filePath))
|
|
return JsonConvert.DeserializeObject<UpdateProject>(File.ReadAllText(filePath));
|
|
else
|
|
return new();
|
|
}
|
|
|
|
public void Save(string filePath)
|
|
{
|
|
File.WriteAllText(filePath, JsonConvert.SerializeObject(this));
|
|
}
|
|
}
|