re-organze namespace
This commit is contained in:
24
ModpackUpdater/ModpackConfig.cs
Normal file
24
ModpackUpdater/ModpackConfig.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ModpackUpdater;
|
||||
|
||||
public class ModpackConfig
|
||||
{
|
||||
public bool Maintenance { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string UpdateUrl { get; set; }
|
||||
public string InstallUrl { get; set; }
|
||||
public string UnleashApiUrl { get; set; }
|
||||
public string UnleashInstanceId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public string ConfigUrl { get; set; }
|
||||
|
||||
public static ModpackConfig LoadFromUrl(string url)
|
||||
{
|
||||
var result = new HttpClient().GetStringAsync(url).Result;
|
||||
var config = JsonConvert.DeserializeObject<ModpackConfig>(result);
|
||||
config.ConfigUrl = url;
|
||||
return config;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user