You could write a type converter that puts data in a case-insensitive dictionary.
See: Type converters: http://www.castleproject.org/container/documentation/trunk/usersguide/typeconverters.html http://mikehadlow.blogspot.com/2010/02/10-advanced-windsor-tricks-10.html Default generic dictionary type converter: https://github.com/castleproject/Castle.Windsor/blob/master/src/Castle.Windsor/MicroKernel/SubSystems/Conversion/GenericDictionaryConverter.cs Dictionary with custom comparer: http://msdn.microsoft.com/en-us/library/ms132073.aspx -- Mauricio On Fri, Jun 17, 2011 at 1:14 PM, Scott_M <[email protected]>wrote: > I am using a dictionary in castle windsor configuration to build an > authenticator factory. The dictionary key represents a URL and then > the object represents each specific authenticator service. > > //config > <component id="AuthenticatorFactory" lifestyle="singleton" > service="Security.IAuthenticatorFactory, Security" > type="Security.AuthenticatorFactory, Security"> > <parameters> > <authenticators> > <dictionary> > <entry key="https://smpc.acme.com/sts/sts.svc/ > anonymoususer">${AnonymousUserAuthenticator}</entry> > <entry key="https://wcvpc-w7.acme.com/sts/sts.svc/ > anonymoususer">${AnonymousUserAuthenticator}</entry> > <entry key="https://tkpc.acme.com/sts/sts.svc/ > anonymoususer">${AnonymousUserAuthenticator}</entry> > </dictionary> > </authenticators> > </parameters> > </component> > > //code > public class AuthenticatorFactory : IAuthenticatorFactory > { > private Dictionary<string, IAuthenticator> m_authenticators = > new Dictionary<string, IAuthenticator>(); > > public AuthenticatorFactory(Dictionary<string, IAuthenticator> > authenticators) > { > m_authenticators = authenticators; > } > > public IAuthenticator GetAuthenticator(string url) > { > IAuthenticator retVal = null; > > if (m_authenticators.ContainsKey(url)) > { > retVal = m_authenticators[url.ToString()]; > } > > return retVal; > } > } > > By default the dictionary appears to be case sensitive. Is there a > way to have castle construction a case insensitive dictionary? > > > > scottm > > -- > You received this message because you are subscribed to the Google Groups > "Castle Project Users" group. > To post to this group, send email to [email protected] > . > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/castle-project-users?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
