public AsicStats(SettingsData settings, ParsingObject parsingObject = default) { if (parsingObject == default) { ParsingObject = StandardData.StandardParsingObject; } else { ParsingObject = parsingObject; } Settings = settings; }
public static async Task <SettingsData> Get(string path = default) { SettingsData settings = new SettingsData(); try { using (FileStream fs = new FileStream(path + "settings.json", FileMode.OpenOrCreate)) { settings = await JsonSerializer.DeserializeAsync <SettingsData>(fs); } } catch (Exception) { // ignored } return(settings); }
public static async void Save(SettingsData settingsClass, string path = default) { using (FileStream fs = new FileStream(path + "settings.json", FileMode.OpenOrCreate)) { //cleaning fs.SetLength(default);