Exemplo n.º 1
0
        public AsicStats(SettingsData settings, ParsingObject parsingObject = default)
        {
            if (parsingObject == default)
            {
                ParsingObject = StandardData.StandardParsingObject;
            }
            else
            {
                ParsingObject = parsingObject;
            }



            Settings = settings;
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public static async void Save(SettingsData settingsClass, string path = default)
 {
     using (FileStream fs = new FileStream(path + "settings.json", FileMode.OpenOrCreate))
     {
         //cleaning
         fs.SetLength(default);