using System; // ReSharper disable UnusedMember.Global namespace IPA.Config { /// /// An interface for configuration providers. /// public interface IConfigProvider { /// /// Loads the data provided by this into an object of type . /// /// the type of the object to parse into /// the values from the config provider parsed into the object T Parse(); /// /// Stores the data from into the . /// /// the type of /// the object containing the data to save void Store(T obj); #if NET4 /// /// Gets a dynamic object providing access to the configuration. /// /// a dynamically bound object to use to access config values directly dynamic Dynamic { get; } #endif #region State getters /// /// Returns if object has changed since the last save /// /// if object has changed since the last save, else bool HasChanged { get; } /// /// Returns if the data in memory has been changed - notably including loads. /// /// if the data in memory has been changed, else bool InMemoryChanged { get; set; } /// /// Will be set with the filename (no extension) to save to. When saving, the implementation should add the appropriate extension. Should error if set multiple times. /// /// the extensionless filename to save to string Filename { set; } /// /// Gets the last time the config was modified. /// /// the last time the config file was modified DateTime LastModified { get; } /// /// Saves configuration to file. Should error if not a root object. /// void Save(); /// /// Loads the state of the file on disk. /// void Load(); #endregion } }