Skip to content

Instantly share code, notes, and snippets.

@sitefinitySDK
Created October 1, 2017 15:27
SF_10.1, SF_10.2, SF_11.0, SF_11.1, SF_11.2, SF_12.0, SF_12.1, SF_12.2, SF_13.0, SF_13.1, SF_13.2, SF_13.3, SF_14.0, SF_14.1, SF_14.2, SF_14.3 - https://docs.sitefinity.com/for-developers-create-a-new-configuration
using System;
using System.Configuration;
using Telerik.Sitefinity.Configuration;
namespace SitefinityWebApp
{
public class FontElement : ConfigElement
{
public FontElement(ConfigElement parent)
: base(parent)
{
}
[ConfigurationProperty("name", DefaultValue = "Arial", IsRequired = true, IsKey = true)]
public String Name
{
get
{
return (String)this["name"];
}
set
{
this["name"] = value;
}
}
[ConfigurationProperty("size", DefaultValue = "12", IsRequired = false)]
public int Size
{
get
{
return (int)this["size"];
}
set
{
this["size"] = value;
}
}
}
public class ColorElement : ConfigElement
{
public ColorElement(ConfigElement parent)
: base(parent)
{
}
[ConfigurationProperty("background", DefaultValue = "FFFFFF", IsRequired = true, IsKey = true)]
public String Background
{
get
{
return (String)this["background"];
}
set
{
this["background"] = value;
}
}
[ConfigurationProperty("foreground", DefaultValue = "000000", IsRequired = true)]
public String Foreground
{
get
{
return (String)this["foreground"];
}
set
{
this["foreground"] = value;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment