Skip to content

Instantly share code, notes, and snippets.

@miensol
Created December 25, 2015 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miensol/f5801742f7a039c820dc to your computer and use it in GitHub Desktop.
Save miensol/f5801742f7a039c820dc to your computer and use it in GitHub Desktop.
SimpleConfigSections samples
public class PageAppearanceSection : ConfigurationSection<IPageAppearance>
{
}
public interface IPageAppearance
{
bool RemoteOnly { get; }
IFont Font { get; }
IColor Color { get; }
}
public interface IFont
{
[DefaultValue("Arial")]
string Name { get; }
[DefaultValue(12)]
[Range(minimum:6, maximum:24)]
int Size { get; }
}
public interface IColor
{
[DefaultValue("FFFFFF")]
[RegularExpression("[A-Fa-f0-9]{6}")]
string Background { get; }
[DefaultValue("000000")]
[RegularExpression("[A-Fa-f0-9]{6}")]
string Foreground { get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment