1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Configuration;
- namespace SuperSocket.SocketBase.Config
- {
-
-
-
- [ConfigurationCollection(typeof(TypeProvider))]
- public class TypeProviderCollection : ConfigurationElementCollection, IEnumerable<ITypeProvider>
- {
-
-
-
-
-
-
- protected override ConfigurationElement CreateNewElement()
- {
- return new TypeProvider() as ConfigurationElement;
- }
-
-
-
-
-
-
-
- protected override object GetElementKey(ConfigurationElement element)
- {
- var provider = element as TypeProvider;
- if (provider == null)
- return null;
- return provider.Name;
- }
-
-
-
-
-
-
- public new IEnumerator<ITypeProvider> GetEnumerator()
- {
- int count = base.Count;
- for (int i = 0; i < count; i++)
- {
- yield return (ITypeProvider)base.BaseGet(i);
- }
- }
- }
- }
|