Пример #1
0
        /// <summary>
        /// This method is called by ASP.NET system on web application's startup.
        /// </summary>
        protected virtual void Application_Start(object sender, EventArgs e)
        {
            IocManager.Instance.IocContainer.Register(Component.For<IAssemblyFinder>().ImplementedBy<WebAssemblyFinder>());

            AbpBootstrapper = new AbpBootstrapper();
            AbpBootstrapper.Initialize();
        }
        private static AbpBootstrapper AddAbpBootstrapper <TStartupModule>(IServiceCollection services, Action <AbpBootstrapperOptions> optionsAction)
            where TStartupModule : AbpModule
        {
            var abpBootstrapper = AbpBootstrapper.Create <TStartupModule>(optionsAction);

            services.AddSingleton(abpBootstrapper);
            return(abpBootstrapper);
        }
Пример #3
0
 protected void CleanUp()
 {
     if (_bootstrapper != null)
     {
         _bootstrapper.Dispose();
         _bootstrapper = null;
     }
 }
Пример #4
0
 protected void Configure()
 {
     if (_bootstrapper == null)
     {
         _bootstrapper = AbpBootstrapper.Create <DCServicesModule>();
         _bootstrapper.Initialize();
     }
 }
        private static AbpBootstrapper AddAbpBootstrapper <TStartupModule>(IServiceCollection services, IIocManager iocManager)
            where TStartupModule : AbpModule
        {
            var abpBootstrapper = AbpBootstrapper.Create <TStartupModule>(iocManager);

            services.AddSingleton(abpBootstrapper);
            return(abpBootstrapper);
        }
        public JsonAndXmlSourceMixing_Tests()
        {
            LocalIocManager.Register<ILanguageManager, LanguageManager>();
            LocalIocManager.Register<ILanguageProvider, DefaultLanguageProvider>();

            _bootstrapper = AbpBootstrapper.Create<MyLangModule>(LocalIocManager);
            _bootstrapper.Initialize();
        }
Пример #7
0
        public JsonAndXmlSourceMixing_Tests()
        {
            LocalIocManager.Register <ILanguageManager, LanguageManager>();
            LocalIocManager.Register <ILanguageProvider, DefaultLanguageProvider>();

            _bootstrapper = AbpBootstrapper.Create <MyLangModule>(LocalIocManager);
            _bootstrapper.Initialize();
        }
Пример #8
0
        protected AbpStartup(IHostingEnvironment env, bool initialize = true)
        {
            AbpBootstrapper = new AbpBootstrapper();

            if (initialize)
            {
                InitializeAbp();
            }
        }
        public static HostConfigurator UseAbp(this HostConfigurator configurator, AbpBootstrapper abpBootstrapper)
        {
            var log = HostLogger.Get(typeof(HostConfiguratorExtensions));

            log.Info("[Topshelf.Abp] Integration Started in host.");

            configurator.AddConfigurator(new AbpBuilderConfigurator(abpBootstrapper));
            return(configurator);
        }
Пример #10
0
        public async Task Enable(EntityDto <long> input)
        {
            var user = _userRepository.Get(input.Id);

            user.IsActive = !user.IsActive;
            await _userRepository.UpdateAsync(user);

            var im_Service = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IM_UserManager>();

            try
            {
                if (user.IsActive)
                {
                    im_Service.EnableIMUser(input.Id.ToString());
                }
                else
                {
                    //如果是部门领导 则取消部门领导负责人
                    var org = _workflowOrganizationUnitsRepository.GetAll().Where(ite => ite.Leader.Contains(input.Id.ToString()) || ite.ChargeLeader.Contains(input.Id.ToString())).ToList();
                    foreach (var o in org)
                    {
                        if (o.Leader.Contains(input.Id.ToString()))
                        {
                            var users = o.Leader.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList();
                            foreach (var u in users)
                            {
                                if (u == "u_" + input.Id.ToString())
                                {
                                    users.Remove(u);
                                    break;
                                }
                            }
                            o.Leader = string.Join(",", users);
                        }
                        if (o.ChargeLeader.Contains(input.Id.ToString()))
                        {
                            var users = o.ChargeLeader.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList();
                            foreach (var u in users)
                            {
                                if (u == "u_" + input.Id.ToString())
                                {
                                    users.Remove(u);
                                    break;
                                }
                            }
                            o.ChargeLeader = string.Join(",", users);
                        }
                        _workflowOrganizationUnitsRepository.Update(o);
                    }
                    CurrentUnitOfWork.SaveChanges();
                    im_Service.DisableIMUser(input.Id.ToString());
                }
            }
            catch (Exception ex)
            {
            }
        }
Пример #11
0
        private static void SearchClubs()
        {
            AbpBootstrapper bootstrapper = new AbpBootstrapper();

            bootstrapper.Initialize();

            IClubAppService clubService = bootstrapper.IocManager.Resolve <IClubAppService>();
            //var result = clubService.SearchClubs(new CatchApp.Geodata.GeoPoint(46.599550, 14.270328));
        }
Пример #12
0
 static void AbpBootStrapper()
 {
     _bootstrapper = AbpBootstrapper.Create <CoundFlareModule>();
     _bootstrapper.IocManager.IocContainer
     .AddFacility <LoggingFacility>(f => f.UseAbpLog4Net()
                                    .WithConfig("log4net.config")
                                    );
     _bootstrapper.Initialize();
 }
Пример #13
0
        public App()
        {
            this.Startup += App_Startup;
            Current.DispatcherUnhandledException       += Current_DispatcherUnhandledException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            _bootstrapper = AbpBootstrapper.Create <IFoxtecWPFModule>();
            _bootstrapper.IocManager.IocContainer.AddFacility <LoggingFacility>(f => f.UseAbpLog4Net().WithConfig("log4net.config"));
        }
Пример #14
0
 public App()
 {
     _bootstrapper = AbpBootstrapper.Create <ParkBoxWpfModule>();
     _bootstrapper.IocManager.IocContainer.AddFacility <LoggingFacility>(x => x.UseLog4Net().WithConfig("log4net.config"));
     _logger = NullLogger.Instance;
     this.DispatcherUnhandledException  += App_DispatcherUnhandledException;
     this.Dispatcher.UnhandledException += Dispatcher_UnhandledException;
     App.Current.ShutdownMode            = ShutdownMode.OnExplicitShutdown;
 }
Пример #15
0
        static void Main(string[] args)
        {
            try
            {
                using (var bootstrapper = new AbpBootstrapper())
                {
                    bootstrapper.Initialize();

                    using (var client = bootstrapper.IocManager.ResolveAsDisposable <MyTestClient>())
                    {
                        Console.Write("Enter tenancy (demo) name: ");
                        client.Object.TenancyName = Console.ReadLine();
                        if (client.Object.TenancyName.IsNullOrWhiteSpace())
                        {
                            return;
                        }

                        Console.Write("Enter username: "******"Enter password: "******"Logging in...");

                        client.Object.Login();

                        Console.WriteLine("Getting roles...");

                        var roles = AsyncHelper.RunSync(() => client.Object.GetRolesAsync());

                        Console.WriteLine(roles.Items.Count + " roles found:");
                        foreach (var role in roles.Items)
                        {
                            Console.WriteLine("Role: Id=" + role.Id + ", DisplayName=" + role.DisplayName + ", IsDefault=" + role.IsDefault);
                        }
                    }
                }
            }
            catch (AbpRemoteCallException ex)
            {
                Console.WriteLine(ex.ToString());
            }

            Console.WriteLine();
            Console.WriteLine("Press ENTER to exit...");
            Console.ReadLine();
        }
Пример #16
0
        public Service1()
        {
            InitializeComponent();
            _bootstrapper = AbpBootstrapper.Create <AbpHangFireService>();

            _bootstrapper.IocManager.IocContainer
            .AddFacility <LoggingFacility>(f => f.UseAbpLog4Net()
                                           .WithConfig("log4net.config")
                                           );
        }
Пример #17
0
        public JsonAndXmlSourceMixing_Tests()
        {
            LocalIocManager.Register <IModuleFinder, MyTestModuleFinder>();

            LocalIocManager.Register <ILanguageManager, LanguageManager>();
            LocalIocManager.Register <ILanguageProvider, DefaultLanguageProvider>();

            _bootstrapper = new AbpBootstrapper(LocalIocManager);
            _bootstrapper.Initialize();
        }
Пример #18
0
        public static void Initialize()
        {
            if (_bootstrapper != null)
            {
                return;
            }

            _bootstrapper = new AbpBootstrapper <TTenantId, TUserId>();
            _bootstrapper.Initialize();
        }
        protected AbpIntegratedTestBase(bool initializeAbp = true)
        {
            LocalIocManager = new IocManager();
            AbpBootstrapper = AbpBootstrapper.Create <TStartupModule>(LocalIocManager);

            if (initializeAbp)
            {
                InitializeAbp();
            }
        }
Пример #20
0
        public static void Initialize()
        {
            if (_bootstrapper != null)
            {
                return;
            }

            _bootstrapper = new AbpBootstrapper();
            _bootstrapper.Initialize();
        }
Пример #21
0
        public static void Initialize()
        {
            if (_bootstrapper != null)
            {
                return;
            }

            _bootstrapper = AbpBootstrapper.Create<AbpWebApiTestModule>();
            _bootstrapper.Initialize();
        }
Пример #22
0
        static void Main(string[] args)
        {
            using (var bootstrapper = new AbpBootstrapper())
            {
                bootstrapper.Initialize();

                new SocketRemotingServer().RegisterRequestHandler(100, new RequestHandler()).Start();
                Console.ReadLine();
            }
        }
        public DefaultLanguageProvider_Test()
        {
            LocalIocManager.Register <ILanguageProvider, DefaultLanguageProvider>();
            var bootstrapper = AbpBootstrapper.Create <DefaultLanguageProviderLangModule>(options =>
            {
                options.IocManager = LocalIocManager;
            });

            bootstrapper.Initialize();
        }
        public JsonAndXmlSourceMixing_Tests()
        {
            LocalIocManager.Register<IModuleFinder, MyTestModuleFinder>();

            LocalIocManager.Register<ILanguageManager, LanguageManager>();
            LocalIocManager.Register<ILanguageProvider, DefaultLanguageProvider>();

            _bootstrapper = new AbpBootstrapper(LocalIocManager);
            _bootstrapper.Initialize();
        }
Пример #25
0
        protected AbpIntegratedTestBase(bool initializeAbp = true)
        {
            LocalIocManager = new IocManager();
            AbpBootstrapper = new AbpBootstrapper(LocalIocManager);

            if (initializeAbp)
            {
                InitializeAbp();
            }
        }
        protected void InitializeAbp()
        {
            LocalIocManager.Register <IAbpSession, TestAbpSession>();

            PreInitialize();

            AbpBootstrapper.Initialize();

            AbpSession = LocalIocManager.Resolve <TestAbpSession>();
        }
Пример #27
0
        static void Main(string[] args)
        {
            using (var bootstrapper = new AbpBootstrapper())
            {
                bootstrapper.Initialize();

                var test = IocManager.Instance.Resolve <IUserService>();
                test.GetAllUsers();
            }
        }
        public static void Initialize()
        {
            if (_bootstrapper != null)
            {
                return;
            }

            _bootstrapper = AbpBootstrapper.Create <AbpWebApiTestModule>();
            _bootstrapper.Initialize();
        }
Пример #29
0
 public static void Initialize()
 {
     if (_bootstrapper != null)
     {
         return;
     }
     
     _bootstrapper = new AbpBootstrapper();
     _bootstrapper.Initialize();
 }
        private static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
        .ConfigureServices(services =>
        {
            var abpBootstrapper = AbpBootstrapper.Create <SampleWorkerServiceModule>();
            services.AddSingleton(abpBootstrapper);
            abpBootstrapper.Initialize();

            services.AddHostedService <Worker>();
        })
        .UseCastleWindsor(IocManager.Instance.IocContainer);
        public static LinqPadAbp InitModule <TModule>()
            where TModule : AbpModule
        {
            Console.WriteLine("Initializing Module");
            var bootstrapper = AbpBootstrapper.Create <TModule>();

            bootstrapper.IocManager.Register <ILinqPadContextGetter, LinqPadContextGetter>();
            bootstrapper.IocManager.Register <IUnitOfWork, LinqPadUow>(DependencyLifeStyle.Transient);
            bootstrapper.Initialize();
            return(new LinqPadAbp(bootstrapper));
        }
Пример #32
0
        private static void InitAbp(AbpBootstrapper bootstrapper)
        {
            bootstrapper.IocManager.IocContainer
            .AddFacility <LoggingFacility>(f => f.UseAbpLog4Net()
                                           .WithConfig("log4net.config")
                                           );
            // 可以注入 _appConfiguration

            bootstrapper.Initialize();
            iocManager = bootstrapper.IocManager;
        }
        /// <summary>
        /// This method is called by ASP.NET system on web application's startup.
        /// </summary>
        protected virtual void Application_Start(object sender, EventArgs e)
        {
            //TODO: Use AbpBootstrapper.IocManager
            IocManager.Instance.IocContainer.Register(Component.For<IAssemblyFinder>().ImplementedBy<WebAssemblyFinder>());

            //TODO: Use AbpBootstrapper.IocManager
            //TODO: Move to AbpWebModule?
            IocManager.Instance.IocContainer.Register(Component.For<ICurrentUnitOfWorkProvider>().ImplementedBy<HttpContextCurrentUnitOfWorkProvider>());

            AbpBootstrapper = new AbpBootstrapper();
            AbpBootstrapper.Initialize();
        }
Пример #34
0
        protected AbpStartup(IHostingEnvironment env, bool initialize = true)
        {
            //TODO: TEST
            XmlLocalizationSource.RootDirectoryOfApplication = env.WebRootPath;

            AbpBootstrapper = new AbpBootstrapper();

            if (initialize)
            {
                InitializeAbp();
            }
        }
 static void Main(string[] args)
 {
     //Bootstrapping ABP system
     using (var bootstrapper = AbpBootstrapper.Create <MYMODULE>())
     {
         IocManager.Instance.IocContainer.AddFacility <LoggingFacility>(f => f.UseAbpLog4Net().WithConfig("log.config"));
         bootstrapper.Initialize();
         Console.WriteLine("Press enter to exit...");
         Console.ReadLine();
     }
     Console.ReadLine();
 }
Пример #36
0
        public static void Main(string[] args)
        {
            var bootstrapper = AbpBootstrapper.Create <TestAbpRemoteEventBusModule>();


            //bootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(f =>
            //   f.UseAbpLog4Net().WithConfig("log4net.config"));

            bootstrapper.Initialize();

            CreateWebHostBuilder(args).Build().Run();
        }
Пример #37
0
        protected AbpStartup(IHostingEnvironment env, bool initialize = true)
        {
            //TODO: TEST
            XmlLocalizationSource.RootDirectoryOfApplication = env.WebRootPath;

            AbpBootstrapper = new AbpBootstrapper();

            if (initialize)
            {
                InitializeAbp();
            }
        }
 protected AbpWebApplication()
 {
     AbpBootstrapper = new AbpBootstrapper();
 }
 public AbpBootstraper_Tester()
 {
     _bootstrapper = new AbpBootstrapper(LocalIocManager);
 }
 public AbpBootstraper_Tester()
 {
     _bootstrapper = AbpBootstrapper.Create<MyTestModule>(LocalIocManager);
 }
Пример #41
0
 /// <summary>
 /// This method is called by ASP.NET system on web application's startup.
 /// </summary>
 protected virtual void Application_Start(object sender, EventArgs e)
 {
     AbpBootstrapper = new AbpBootstrapper();
     AbpBootstrapper.Initialize();
 }
 private static AbpBootstrapper AddAbpBootstrapper(IServiceCollection services, IIocManager iocManager)
 {
     var abpBootstrapper = new AbpBootstrapper(iocManager);
     services.AddSingleton(abpBootstrapper);
     return abpBootstrapper;
 }