public DefaultSimpleServiceLocator(bool useConcurrentDictionary = false) { if (useConcurrentDictionary) { services = new SafeConcurrentDictionary <Type, ServiceEntry>(); } else { services = new SafeDictionary <Type, ServiceEntry>(); } }
public ReflectionPropertyCache(bool useConcurrentDictionary = true) { this.useConcurrentDictionary = useConcurrentDictionary; if (useConcurrentDictionary) { propStore = new SafeConcurrentDictionary <Type, ISafeDictionary <BindingFlags, List <PropertyInfo> > >(); } else { propStore = new SafeDictionary <Type, ISafeDictionary <BindingFlags, List <PropertyInfo> > >(); } }
public PropertyProvider(bool useConcurrentDictionary = true) { this.useConcurrentDictionary = useConcurrentDictionary; if (useConcurrentDictionary) { propertyAccessorStore = new SafeConcurrentDictionary <Type, ISafeDictionary <string, PropertyAccessor> >(); } else { propertyAccessorStore = new SafeDictionary <Type, ISafeDictionary <string, PropertyAccessor> >(); } }
public DefaultServiceLocator(ILifeTimeFactory lifeTimeFactory, bool useConcurrentDictionary = false) { this.useConcurrentDictionary = useConcurrentDictionary; this.services = GetDictionary <Type, ISafeDictionary <Type, LifeTimeManager> >(); this.LifeTimeFactory = lifeTimeFactory ?? new DefaultLifeTimeFactory(); }
static GlobalPropertyProvider() { Cache = new SafeConcurrentDictionary <Type, ISafeDictionary <string, PropertyAccessor> >(); }