Example #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var currentAssembly = typeof(MyCanvasAppActionInvoker).Assembly;
            var domainAssemblies = new[]
                                   	{
                                   		typeof (IApplicationSettings).Assembly,
                                   		typeof (IPlatformConfiguration).Assembly,
                                        currentAssembly
                                   	};

            // IOC
            _container = new CommonContainer();
            _container.RegisterTypes(new Dictionary<Type, Type> { { typeof(IActionInvoker), typeof(MyCanvasAppActionInvoker) } });

            var log4NetConfigurator = new Log4NetConfigurator { Container = _container };
            log4NetConfigurator.Configure();

            _container.AutoWire(domainAssemblies);

            RoutesRegistrar.RegisterRoutes(RouteTable.Routes, new[] { currentAssembly });
            var controllerTypes = RoutesRegistrar.GetControllerTypes(new[] { currentAssembly }).ToArray();
            _container.RegisterTransients(controllerTypes);
            var controllerFactory = new WindsorControllerFactory(_container);
            ControllerBuilder.Current.SetControllerFactory(controllerFactory);

            // Events
            _container.AutoWireEvents(domainAssemblies);
        }
Example #2
0
        private void Initialize()
        {
            _container = new CommonContainer();
            var bootstrapper = new Bootstrapper(_container);

            bootstrapper.RegisterEverything();
        }
Example #3
0
        public Bootstrapper(ICommonContainer container)
        {
            _container = container;

            _currentAssembly = Assembly.GetExecutingAssembly();
            _assemblies = new[]
            {
                _currentAssembly,
                typeof (ILogger).Assembly,
                typeof (Entity).Assembly
            };
        }
Example #4
0
        public Bootstrapper(ICommonContainer container)
        {
            _container = container;

            _currentAssembly = Assembly.GetExecutingAssembly();
            _assemblies      = new[]
            {
                _currentAssembly,
                typeof(ILogger).Assembly,
                typeof(Entity).Assembly
            };
        }
Example #5
0
 private void Initialize()
 {
     _container = new CommonContainer();
     var bootstrapper = new Bootstrapper(_container);
     bootstrapper.RegisterEverything();
 }