public async Task Save(SettingsBase settings) { await settings.OnSaving(); string path = SettingsDirectory + settings.GetType().Name + ".json"; string json = JsonConvert.SerializeObject(settings, Formatting.Indented); File.WriteAllText(path, json); }