using System; using System.Collections.Generic; namespace InABox.Configuration { public interface IConfiguration { public string[] Sections(); T Load(bool useCache = true); Dictionary LoadAll(); void Save(T obj); /// /// Save all to the configuration. /// /// /// This does not do a complete replace; that is, it only changes the configurations with the keys of , /// as if was called for each element in /// /// void SaveAll(Dictionary objs); void Delete(Action? callback = null); } public abstract class Configuration : IConfiguration { public Configuration(string section = "") { Section = section; } public string Section { get; } public abstract string[] Sections(); public abstract Dictionary LoadAll(); public abstract T Load(bool useCache = true); public abstract void Save(T obj); public abstract void SaveAll(Dictionary objs); public abstract void Delete(Action? callback); } public interface IConfigurationSettings { } public delegate T LoadSettings(object sender) where T : IConfigurationSettings; public delegate void SaveSettings(object sender, T properties) where T : IConfigurationSettings; }