コード例 #1
0
ファイル: AsicStats.cs プロジェクト: VlaanH/AntStatsXamarin
        public AsicStats(SettingsData settings, ParsingObject parsingObject = default)
        {
            if (parsingObject == default)
            {
                ParsingObject = StandardData.StandardParsingObject;
            }
            else
            {
                ParsingObject = parsingObject;
            }



            Settings = settings;
        }
コード例 #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);
        }
コード例 #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);