websitepanel/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebConfigSections/OfficeOnlineElementCollection.cs
2014-12-03 11:43:26 +03:00

36 lines
No EOL
1.1 KiB
C#

using System;
using System.Configuration;
namespace WebsitePanel.WebDavPortal.WebConfigSections
{
[ConfigurationCollection(typeof(OfficeOnlineElement))]
public class OfficeOnlineElementCollection : ConfigurationElementCollection
{
private const string UrlKey = "url";
private const string IsEnabledKey = "isEnabled";
[ConfigurationProperty(UrlKey, IsKey = true, IsRequired = true)]
public string Url
{
get { return this[UrlKey].ToString(); }
set { this[UrlKey] = value; }
}
[ConfigurationProperty(IsEnabledKey, IsKey = true, IsRequired = true, DefaultValue = false)]
public bool IsEnabled
{
get { return Boolean.Parse(this[IsEnabledKey].ToString()); }
set { this[IsEnabledKey] = value; }
}
protected override ConfigurationElement CreateNewElement()
{
return new OfficeOnlineElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((OfficeOnlineElement)element).Extension;
}
}
}