コード例 #1
0
ファイル: Program.cs プロジェクト: nydehi/openuo
        static void Main()
        {
            EngineBootstrapper boostrapper = new EngineBootstrapper();
            boostrapper.Run();

            using (Engine engine = new Engine(boostrapper.Kernel))
            {
                engine.Run();
            }
        }
コード例 #2
0
        /// <summary>
        /// Creates mappings of interfaces to concrete objects
        /// </summary>
        /// <param name="container"></param>
        public static void RegisterTypes(IUnityContainer container)
        {
            ManagerBootstrapper.RegisterTypes(container);
            EngineBootstrapper.RegisterTypes(container);
            AccessorBootstrapper.RegisterTypes(container);

            // The following would require concrete classes be public
            //container.RegisterType<IPriceManager, PriceManager>();
            //container.RegisterType<IProductParserEngine, ProductParserEngine>();
            //container.RegisterType<IWebPageEngine, WebPageEngine>();
            //container.RegisterType<IProductAccessor, ProductAccessor>();
            //container.RegisterType<IEmailAccessor, EmailAccessor>();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: TormentedEmu/OpenUO
        static void Main(string[] args)
        {
            EngineBootstrapper boostrapper = new EngineBootstrapper();
            boostrapper.Run();

            IConfiguration config = boostrapper.Container.Resolve<IConfiguration>();

            if (!config.FileExists)
                config.RestoreDefaults();

            using (Engine engine = boostrapper.Container.Resolve<Engine>())
            {
                engine.Run();
            }
        }