コード例 #1
0
        public void Build(IContainerBuilder containerBuilder, IBuilderContext context)
        {
            //TODO: Why is this done? --Aaron
            var textManager = LocalizationConfig.SetupDefault();

            containerBuilder.ForFactory(x => LocalizationConfig.TextManager)
            .ScopedAs.Singleton();
        }
コード例 #2
0
        /// <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();
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
 public static DefaultTextManager SetupDefaultManager(Assembly appAssembly, string overridesPath = null)
 {
     return((DefaultTextManager)ApplyDefaults(appAssembly, LocalizationConfig.SetupDefault(), overridesPath));
 }