Beispiel #1
0
        public static void SetExpectedTemperature(SettingsEntry entry)
        {
            var settings = new TemperatureSettings {
                Settings = GetDefaultSettings()
            };

            SaveSettings(settings);
        }
Beispiel #2
0
        public static void SaveSettings(TemperatureSettings settings)
        {
            if (settings == null)
            {
                settings = new TemperatureSettings
                {
                    Id       = Guid.NewGuid(),
                    Settings = GetDefaultSettings()
                };
            }
            var appdata      = AppDomain.CurrentDomain.GetData("DataDirectory").ToString();
            var path         = $@"{appdata}\TemperatureSettings.json";
            var settingsJson = JsonConvert.SerializeObject(settings, Formatting.Indented);

            File.WriteAllText(path, settingsJson);
        }