public RconServerManager() { instance = this; servers = new RconServerCollection(); rconDataFilePath = Path.Combine(Application.UserAppDataPath, "RconServers.json"); }
public void Save() { string data = JsonConvert.SerializeObject(servers); File.WriteAllText(rconDataFilePath, data); previouslySavedServers = servers; unsavedChanges = false; }
public void Load() { if (!File.Exists(rconDataFilePath)) { //Test(); return; } string data = File.ReadAllText(rconDataFilePath); RconServer[] rconServers = JsonConvert.DeserializeObject <RconServer[]>(data); servers.AddRange(rconServers); previouslySavedServers = servers; }
public void RevertUnsavedChanges() { servers = previouslySavedServers; }