Пример #1
0
        /// <summary>
        /// 启动项注册
        /// </summary>
        protected void ConfigureServices()
        {
            AutofacLocator autofacLocator = new AutofacLocator(); //创建IOC容器

            autofacLocator.Register();                            //注册服务
            BootStrapper.Initialize(autofacLocator);
        }
Пример #2
0
        /// <summary>
        /// 启动项注册
        /// </summary>
        protected void ConfigureServices()
        {
            AutofacLocator autofacLocator = new AutofacLocator();  //创建IOC容器
            Assembly       asm            = Assembly.GetExecutingAssembly();

            autofacLocator.Register(asm);   //注册服务
            BootStrapper.Initialize(autofacLocator, asm);
        }
Пример #3
0
        public App()
        {
            InitializeComponent();
            Constants.InitAsync(Instance);
            AutofacLocator autofac = new AutofacLocator();

            autofac.Register();
            ServiceProvider.RegisterSerivceLocator(autofac);
            MainPage = new NavigationPage(new MainPage());
        }
Пример #4
0
        protected void ConfigureServices()
        {
            AutofacLocator   locator = new AutofacLocator();
            ContainerBuilder builder = new ContainerBuilder();

            builder.RegisterType(typeof(LoginCenter)).Named("LoginCenter", typeof(IModuleDialog));


            locator.Register(builder);
            AutofacProvider.RegisterServiceLocator(locator);
        }
Пример #5
0
        protected void ConfigureServices()
        {
            AutofacLocator   locator = new AutofacLocator();
            ContainerBuilder builder = new ContainerBuilder();

            builder.RegisterType <ConsumptionService>().As <IConsumptionService>();
            builder.RegisterType(typeof(LoginCenter)).Named("LoginCenter", typeof(IModuleDialog));
            builder.RegisterType(typeof(MainCenter)).Named("MainCenter", typeof(IModuleDialog));
            builder.RegisterType(typeof(SkinCenter)).Named("SkinCenter", typeof(IModule));
            builder.RegisterType(typeof(UserCenter)).Named("UserCenter", typeof(IModule));
            builder.RegisterType(typeof(MenuCenter)).Named("MenuCenter", typeof(IModule));
            builder.RegisterType(typeof(BasicCenter)).Named("BasicCenter", typeof(IModule));
            locator.Register(builder);
            AutofacProvider.RegisterServiceLocator(locator);
        }