/// Creates a linked <see cref="Ref{T}"/> for the config provider. This <see cref="Ref{T}"/> will be automatically updated whenever the file on-disk changes.
/// </summary>
/// <typeparam name="T">the type of the parsed value</typeparam>
/// <param name="config">the <see cref="IConfigProvider"/> to create a link to</param>
/// <param name="onChange">an action to perform on value change</param>
/// <returns>a <see cref="Ref{T}"/> to an ever-changing value, mirroring whatever the file contains.</returns>
/// Implementers must provide a default constructor. Do not assume that <see cref="File"/> will ever be set for a given object.
/// </remarks>
publicinterfaceIConfigProvider
publicinterfaceIConfigProvider
{// TODO: rework this
{
/// <summary>
/// <summary>
/// Loads the data provided by this <see cref="IConfigProvider"/> into an object of type <typeparamref name="T"/>.
/// Gets the extension <i>without</i> a dot to use for files handled by this provider.
/// </summary>
/// </summary>
/// <typeparam name="T">the type of the object to parse into</typeparam>
/// <returns>the values from the config provider parsed into the object</returns>
TParse<T>();
/// <summary>
/// Stores the data from <paramref name="obj"/> into the <see cref="IConfigProvider"/>.
/// </summary>
/// <typeparam name="T">the type of <paramref name="obj"/></typeparam>
/// <param name="obj">the object containing the data to save</param>
voidStore<T>(Tobj);
/// <remarks>
/// This must work immediately, and is used to generate the <see cref="FileInfo"/> used to set
/// <see cref="File"/>.
/// </remarks>
stringExtension{get;}
#if NET4
/// <summary>
/// <summary>
/// Gets a dynamic object providing access to the configuration.
/// Sets the file that this provider will read and write to.
/// </summary>
/// </summary>
/// <value>a dynamically bound object to use to access config values directly</value>
dynamicDynamic{get;}
#endif
/// <remarks>
/// The provider is expected to gracefully handle this changing at any point,
/// and is expected to close any old file handles when this is reassigned.
/// This may be set to the same file multiple times in this object's lifetime.
/// This will always have been set at least once before any calls to <see cref="Load"/>
/// or <see cref="Store"/> are made.
/// </remarks>
FileInfoFile{set;}
#region State getters
/// <summary>
/// Returns <see langword="true"/> if object has changed since the last save
/// </summary>
/// <value><see langword="true"/> if object has changed since the last save, else <see langword="false"/></value>
boolHasChanged{get;}
/// <summary>
/// Returns <see langword="true"/> if the data in memory has been changed - notably including loads.
/// </summary>
/// <value><see langword="true"/> if the data in memory has been changed, else <see langword="false"/></value>
boolInMemoryChanged{get;set;}
/// <summary>
/// <summary>
/// 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.
/// Stores the <see cref="Value"/> given to disk in the format specified.
/// </summary>
/// </summary>
/// <value>the extensionless filename to save to</value>
stringFilename{set;}
/// <summary>
/// Gets the last time the config was modified.
/// </summary>
/// <value>the last time the config file was modified</value>
DateTimeLastModified{get;}
/// <summary>
/// Saves configuration to file. Should error if not a root object.
/// </summary>
voidSave();
/// <param name="value">the <see cref="Value"/> to store</param>
voidStore(Valuevalue);
/// <summary>
/// <summary>
/// Loads the state of the file on disk.
/// Loads a <see cref="Value"/> from disk in whatever format this provider provides