26 lines
778 B
C#
26 lines
778 B
C#
using Newtonsoft.Json.Linq;
|
|
using Pilz.Updating.Administration.Discord;
|
|
using System.IO;
|
|
|
|
namespace Pilz.Updating.Administration;
|
|
|
|
public class UpdateProject
|
|
{
|
|
public UpdateServerConfig UpdateServerConfig { get; } = new UpdateServerConfig();
|
|
public DiscordBotConfig DiscordBotConfig { get; } = new DiscordBotConfig();
|
|
public ProxyConfiguration ProxyConfig { get; } = new ProxyConfiguration();
|
|
|
|
public static UpdateProject Load(string filePath)
|
|
{
|
|
if (File.Exists(filePath))
|
|
return JObject.Parse(File.ReadAllText(filePath)).ToObject<UpdateProject>();
|
|
else
|
|
return new UpdateProject();
|
|
}
|
|
|
|
public void Save(string filePath)
|
|
{
|
|
File.WriteAllText(filePath, JObject.FromObject(this).ToString());
|
|
}
|
|
}
|