public InterfaceReflectionCache() { _cache = new ConcurrentCache<Type, Cache<Type, Type>>(typeKey => { MissingValueProvider<Type, Type> missingValueProvider = x => GetInterfaceInternal(typeKey, x); return new ConcurrentCache<Type, Type>(missingValueProvider); }); }
public TraceLogWriterFactory() { _logs = new DictionaryCache<string, TraceLogWriter>(CreateTraceLog); _sources = new DictionaryCache<string, TraceSource>(CreateTraceSource); _defaultSource = new TraceSource("Default", SourceLevels.Information); _listener = AddDefaultConsoleTraceListener(_defaultSource); _sources.Get("Topshelf"); }
public TypeNameFormatter(string genericArgumentSeparator, string genericOpen, string genericClose, string namespaceSeparator, string nestedTypeSeparator) { _genericArgumentSeparator = genericArgumentSeparator; _genericOpen = genericOpen; _genericClose = genericClose; _namespaceSeparator = namespaceSeparator; _nestedTypeSeparator = nestedTypeSeparator; _cache = new ConcurrentCache<Type, string>(FormatTypeName); }
public TypeNameFormatter(string genericArgumentSeparator, string genericOpen, string genericClose, string namespaceSeparator, string nestedTypeSeparator) { _genericArgumentSeparator = genericArgumentSeparator; _genericOpen = genericOpen; _genericClose = genericClose; _namespaceSeparator = namespaceSeparator; _nestedTypeSeparator = nestedTypeSeparator; #if NET35 _cache = new ReaderWriterLockedCache<Type, string>(new DictionaryCache<Type, string>(FormatTypeName)); #else _cache = new ConcurrentCache<Type, string>(FormatTypeName); #endif }
public RouteVariablesImpl(IEnumerable<RouteVariable> variables) { _values = new DictionaryCache<string, RouteVariable>(x => x.Name, variables); }
public Counter(Cache.Create<uint> retrieveValueDelegate, string key, TimeSpan? localCacheLifespan) { this.RetrieveValue = retrieveValueDelegate; this.localCacheLifespan = localCacheLifespan; this.Key = key; }
public Counter(Cache.Create<uint> retreiveValueDelegate, string key) : this(retreiveValueDelegate, key, null) { }
public DynamicObjectConverterCache(ImplementationBuilder implementationBuilder) { _implementationBuilder = implementationBuilder; _cache = new ConcurrentCache<Type, ObjectConverter>(CreateMissingConverter); }
public AnonymousObjectDictionaryConverter() { _cache = new ConcurrentCache<Type, Func<object, IDictionary<string, object>>>(CreateObjectToDictionaryConverter); _default = new Dictionary<string, object>(); }
public RouteParametersImpl(IEnumerable<RouteParameter> parameters) { _values = new DictionaryCache<string, RouteParameter>(x => x.Name, parameters); }
public DictionaryConverterCache() { _cache = new GenericTypeCache<DictionaryConverter>(typeof(ObjectDictionaryConverter<>), CreateMissingConverter); }
public static uint GetCounter(this ICounterStore counterStore, CacheKey key, Cache.Create<uint> create) { return counterStore.GetCounter(key.ToString(), create); }
public static uint Increment(this ICounterStore counterStore, CacheKey cacheKey, Cache.Create<uint> create) { return counterStore.Increment(cacheKey.ToString(), create); }
static InstanceBinderContext() { _typeBinders = new GenericTypeCache<ObjectBinder>(typeof(ObjectBinder<>), CreateBinderFor); LoadBuiltInBinders(); }