/*
*
* http://mvcresourceloader.codeplex.com/license
*
* */
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace InteSoft.Web.ExternalResourceLoader{
public class ReferenceElement : ConfigurationElement
{
private static ConfigurationProperty _propFiles;
private static ConfigurationProperty _propName;
private static ConfigurationProperty _propMimeType;
private static ConfigurationPropertyCollection _properties;
public ReferenceElement()
{
EnsureStaticPropertyBag();
}
private static ConfigurationPropertyCollection EnsureStaticPropertyBag()
{
if (_properties == null)
{
_propFiles = new ConfigurationProperty("", typeof(FileCollection), null, ConfigurationPropertyOptions.IsDefaultCollection);
_propName = new ConfigurationProperty("name", typeof(string), string.Empty, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
_propMimeType = new ConfigurationProperty("mimeType", typeof(string), string.Empty, ConfigurationPropertyOptions.IsRequired);
_properties = new ConfigurationPropertyCollection
{
_propFiles,
_propName,
_propMimeType
};
}
return _properties;
}
[ConfigurationProperty("name", DefaultValue = "")]
public string Name
{
get { return (string)base[_propName]; }
set { base[_propName] = value; }
}
[ConfigurationProperty("mimeType", DefaultValue = "text/text")]
public string MimeType
{
get { return (string)base[_propMimeType]; }
set { base[_propMimeType] = value; }
}
protected override ConfigurationPropertyCollection Properties
{
get { return EnsureStaticPropertyBag(); }
}
[ConfigurationProperty("", IsDefaultCollection=true)]
public FileCollection Files
{
get { return (FileCollection)base[_propFiles]; }
}
}
}
|