public void Build(IContainerBuilder containerBuilder, IBuilderContext context) { //TODO: Why is this done? --Aaron var textManager = LocalizationConfig.SetupDefault(); containerBuilder.ForFactory(x => LocalizationConfig.TextManager) .ScopedAs.Singleton(); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> public FakeFrameworkContext() { var fakeMapperList = new List <Lazy <AbstractMappingEngine, TypeMapperMetadata> >(); TypeMappers = new MappingEngineCollection(fakeMapperList); CurrentLanguage = Thread.CurrentThread.CurrentCulture; TextManager = LocalizationConfig.SetupDefault(); ScopedFinalizer = new NestedLifetimeFinalizer(); TaskManager = new ApplicationTaskManager(Enumerable.Empty <Lazy <AbstractTask, TaskMetadata> >()); ApplicationCache = new HttpRuntimeApplicationCache(); ScopedCache = new ThreadStaticScopedCache(); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> public FakeFrameworkContext(ISerializer serializer = null) { serializer = serializer ?? new ServiceStackSerialiser(); var fakeMapperList = new List <Lazy <AbstractMappingEngine, TypeMapperMetadata> >(); TypeMappers = new MappingEngineCollection(fakeMapperList); CurrentLanguage = Thread.CurrentThread.CurrentCulture; TextManager = LocalizationConfig.SetupDefault(); ScopedFinalizer = new NestedLifetimeFinalizer(); TaskManager = new ApplicationTaskManager(Enumerable.Empty <Lazy <AbstractTask, TaskMetadata> >()); ApplicationCache = new HttpRuntimeApplicationCache(); ScopedCache = new DictionaryScopedCache(); Caches = new DefaultFrameworkCaches(new DictionaryCacheProvider(), new RuntimeCacheProvider()); Serialization = new SerializationService(serializer); }
public static DefaultTextManager SetupDefaultManager(Assembly appAssembly, string overridesPath = null) { return((DefaultTextManager)ApplyDefaults(appAssembly, LocalizationConfig.SetupDefault(), overridesPath)); }