[ConfigurationCollection (typeof (HttpHandlerAction), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMapAlternate)]
public sealed class HttpHandlerActionCollection : ConfigurationElementCollection
{
+ static ConfigurationPropertyCollection properties;
+
+ static HttpHandlerActionCollection ()
+ {
+ properties = new ConfigurationPropertyCollection ();
+ }
+
public HttpHandlerActionCollection ()
{
}
public void Add (HttpHandlerAction httpHandlerAction)
{
+ HttpApplication.ClearHandlerCache ();
+ BaseAdd (httpHandlerAction);
}
public void Clear ()
{
+ HttpApplication.ClearHandlerCache ();
+ BaseClear ();
}
protected override ConfigurationElement CreateNewElement ()
{
- throw new NotImplementedException ();
+ return new HttpHandlerAction ();
}
protected override object GetElementKey (ConfigurationElement element)
{
- throw new NotImplementedException ();
+ return ((HttpHandlerAction)element).Path + "-" + ((HttpHandlerAction)element).Verb;
}
public int IndexOf (HttpHandlerAction action)
{
- throw new NotImplementedException ();
+ return BaseIndexOf (action);
}
public void Remove (string verb, string path)
{
+ HttpApplication.ClearHandlerCache ();
+ BaseRemove (path + "-" + verb);
}
public void Remove (HttpHandlerAction action)
{
+ HttpApplication.ClearHandlerCache ();
+ BaseRemove (action.Path + "-" + action.Verb);
}
public void RemoveAt (int index)
{
+ HttpApplication.ClearHandlerCache ();
+ BaseRemoveAt (index);
}
- protected override ConfigurationElementCollectionType CollectionType {
- get {
- throw new NotImplementedException ();
- }
+ public override ConfigurationElementCollectionType CollectionType {
+ get { return ConfigurationElementCollectionType.AddRemoveClearMapAlternate; }
}
protected override ConfigurationPropertyCollection Properties {
- get {
- throw new NotImplementedException ();
- }
+ get { return properties; }
}
public HttpHandlerAction this[int index] {
- get {
- throw new NotImplementedException ();
- }
- set {
- }
+ get { return (HttpHandlerAction)BaseGet (index); }
+ set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
}
protected override bool ThrowOnDuplicate {
- get {
- throw new NotImplementedException ();
- }
+ get { return false; }
}
}
}