1 using System; 2 using System.Collections.Generic; 3 using System.Collections.ObjectModel; 4 using System.Configuration; 5 using System.ServiceModel; 6 using System.ServiceModel.Channels; 7 using System.ServiceModel.Configuration; 8 using System.ServiceModel.Description; 9 using System.ServiceModel.Dispatcher; 10 11 namespace System.ServiceModel.Routing.Configuration 12 { 13 [ConfigurationCollection (typeof(NamespaceElement))] 14 public class NamespaceElementCollection : ConfigurationElementCollection 15 { Add(NamespaceElement element)16 public void Add (NamespaceElement element) 17 { 18 BaseAdd (element); 19 } 20 Clear()21 public void Clear () 22 { 23 BaseClear (); 24 } 25 CreateNewElement()26 protected override ConfigurationElement CreateNewElement () 27 { 28 return new NamespaceElement (); 29 } 30 GetElementKey(ConfigurationElement element)31 protected override object GetElementKey (ConfigurationElement element) 32 { 33 return ((NamespaceElement) element).Prefix; 34 } 35 36 public new NamespaceElement this [string name] { 37 get { 38 foreach (NamespaceElement ne in this) 39 if (ne.Namespace == name) 40 return ne; 41 return null; 42 } 43 } 44 45 public NamespaceElement this [int index] { 46 get { return (NamespaceElement) BaseGet (index); } 47 } 48 IsReadOnly()49 public override bool IsReadOnly () 50 { 51 return base.IsReadOnly (); 52 } 53 Remove(NamespaceElement element)54 public void Remove (NamespaceElement element) 55 { 56 BaseRemove (element); 57 } 58 } 59 } 60