public LogicSettings(GlobalSettings settings) { _settings = settings; }
public ClientSettings(GlobalSettings settings) { _settings = settings; }
public static GlobalSettings Load(string path) { var fullPath = Directory.GetCurrentDirectory() + path; GlobalSettings settings = null; if (File.Exists(fullPath)) { //if the file exists, load the settings var input = File.ReadAllText(fullPath); JsonSerializerSettings jsonSettings = new JsonSerializerSettings(); jsonSettings.Converters.Add(new StringEnumConverter { CamelCaseText = true }); jsonSettings.ObjectCreationHandling = ObjectCreationHandling.Replace; settings = JsonConvert.DeserializeObject<GlobalSettings>(input, jsonSettings); } else { settings = new GlobalSettings(); settings.Save(path); } settings.Auth.Load(GetAuthPath(path)); return settings; }