00001 using System.Configuration; 00002 00003 namespace N2.Configuration 00004 { 00008 [ConfigurationCollection(typeof(ComponentElement))] 00009 public class ComponentCollection : ConfigurationElementCollection 00010 { 00011 protected override ConfigurationElement CreateNewElement() 00012 { 00013 return new ComponentElement(); 00014 } 00015 00016 protected override object GetElementKey(ConfigurationElement element) 00017 { 00018 ComponentElement se = element as ComponentElement; 00019 00020 if (!string.IsNullOrEmpty(se.Service)) 00021 return se.Service; 00022 00023 return se.Implementation; 00024 } 00025 } 00026 }