• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Bootstrapper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Bootstrapper的典型用法代码示例。如果您正苦于以下问题:C# Bootstrapper类的具体用法?C# Bootstrapper怎么用?C# Bootstrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Bootstrapper类属于命名空间,在下文中一共展示了Bootstrapper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            Bootstrapper bootstrapper = new Bootstrapper();
            bootstrapper.Run();
        }
开发者ID:jdhemry,项目名称:UnifiedData,代码行数:7,代码来源:App.xaml.cs


示例2: App

        static App()
        {
            DispatcherHelper.Initialize();

            //AppDomain domain = AppDomain.CurrentDomain;
            //domain.SetupInformation.PrivateBinPath = @"\\Plugins";

            //AppDomainSetup domain = new AppDomainSetup();
            //domain.PrivateBinPath = @"Plugins";

            //FIXME: AppendPrivatePath is deprecated.
            string pluginsFolder = @".\Plugins\";
            string pluginsFolderFullPath = Path.GetFullPath(pluginsFolder);
            if (!Directory.Exists(pluginsFolderFullPath))
                Directory.CreateDirectory(pluginsFolderFullPath);

            AppDomain.CurrentDomain.AppendPrivatePath(pluginsFolderFullPath);

            string[] pluginSubdirectories = Directory.GetDirectories(pluginsFolderFullPath);
            foreach (string pluginSubdirectory in pluginSubdirectories)
            {
                AppDomain.CurrentDomain.AppendPrivatePath(pluginSubdirectory);
            }

            Bootstrapper bootstrapper = new Bootstrapper();
        }
开发者ID:uygary,项目名称:Watchtower,代码行数:26,代码来源:App.xaml.cs


示例3: ApplicationStartup

        protected override void ApplicationStartup(IUnityContainer container, Bootstrapper.IPipelines pipelines)
        {
            RequestContainerConfigured = true;

            container.RegisterType<IFoo, Foo>(new ContainerControlledLifetimeManager());
            container.RegisterType<IDependency, Dependency>(new ContainerControlledLifetimeManager());
        }
开发者ID:denkhaus,项目名称:Nancy.Bootstrappers.Unity,代码行数:7,代码来源:FakeUnityNancyBootstrapper.cs


示例4: TestBase

 public TestBase()
 {
     var bootstrapper = new Bootstrapper();
     host = new NancyHost(bootstrapper, new Uri(path));
     host.Start();
     Console.WriteLine("*** Host listening on " + path);
 }
开发者ID:24hr,项目名称:SimpleHttpClient,代码行数:7,代码来源:TestBase.cs


示例5: Configuration

        public void Configuration(IAppBuilder app)
        {
            //log4net.Config.XmlConfigurator.Configure();

            var bootstrapper = new Bootstrapper();
            var container = bootstrapper.Build();
            var priceFeed = container.Resolve<IPriceFeed>();
            priceFeed.Start();
            var cleaner = container.Resolve<Cleaner>();
            cleaner.Start();

            app.UseCors(CorsOptions.AllowAll);
            app.Map("/signalr", map =>
            {
                var hubConfiguration = new HubConfiguration
                {
                    // you don't want to use that in prod, just when debugging
                    EnableDetailedErrors = true,
                    EnableJSONP = true,
                    Resolver = new AutofacSignalRDependencyResolver(container)
                };

                map.UseCors(CorsOptions.AllowAll)
                    .RunSignalR(hubConfiguration);
            });
        }
开发者ID:dancingchrissit,项目名称:ReactiveTrader,代码行数:26,代码来源:Startup.cs


示例6: GetImporterPlugins

        public static IEnumerable<ICmsImporterPlugin> GetImporterPlugins()
        {
            IEnumerable<ICmsImporterPlugin> plugins = new BindingList<ICmsImporterPlugin>();
            try
            {
                var bootStrapper = new Bootstrapper();

                //An aggregate catalog that combines multiple catalogs
                var catalog = new AggregateCatalog();
                //Adds all the parts found in same directory where the application is running!
                var currentPath = HostingEnvironment.ApplicationPhysicalPath;
                currentPath = String.Format("{0}Bin\\PlugIns", currentPath);

                catalog.Catalogs.Add(new DirectoryCatalog(currentPath));

                //Create the CompositionContainer with the parts in the catalog
                var container = new CompositionContainer(catalog);

                //Fill the imports of this object
                container.ComposeParts(bootStrapper);

                plugins = bootStrapper.ImporterPlugins;
            }
            catch (CompositionException compositionException)
            {
                log.Error("", compositionException, compositionException.Message);
            }
            catch (Exception ex)
            {
                log.Error("", ex, ex.Message);
            }

            return plugins;
        }
开发者ID:barrett2474,项目名称:CMS2,代码行数:34,代码来源:Util.cs


示例7: Main

 private static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     var bootstrapper = new Bootstrapper<MainViewModel>(new AutofacContainer());
     bootstrapper.Start();
 }
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit.Samples,代码行数:7,代码来源:Program.cs


示例8: OnStartup

		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);
			try
			{
				string fileName;
				AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
				ApplicationService.Closing += new System.ComponentModel.CancelEventHandler(ApplicationService_Closing);
				ThemeHelper.LoadThemeFromRegister();
#if DEBUG
				bool trace = false;
				BindingErrorListener.Listen(m => { if (trace) MessageBox.Show(m); });
#endif
				_bootstrapper = new Bootstrapper();
				using (new DoubleLaunchLocker(SignalId, WaitId))
					_bootstrapper.Initialize();
				if (Application.Current != null && e.Args != null && e.Args.Length > 0)
				{
					fileName = e.Args[0];
					FileConfigurationHelper.LoadFromFile(fileName);
				}
			}
			finally
			{
				ServiceFactory.StartupService.Close();
			}
		}
开发者ID:xbadcode,项目名称:Rubezh,代码行数:27,代码来源:App.cs


示例9: Main

        static void Main()
        {
            var container = new Bootstrapper()
                .RegisterComponents()
                .Container;

            using (var uow = container.Resolve<IUnitOfWork>())
            {
                var query = new GetAddressByCity("Bothell");
                var address = uow.ExecuteQuery(query);
                Console.WriteLine("AdventureWorks DB: PLZ von Bothell: {0}", address.PostalCode);
            }

            using (var uow = container.Resolve<IUnitOfWork>())
            {
                var employee = uow.Entities<Employee>().First();
                Console.WriteLine("Northwind DB: Name des ersten Eintrags {0} {1}", employee.FirstName, employee.LastName);
            }

            using (var uow = container.Resolve<IUnitOfWork>())
            {
                var sqlFunction = new GetProductListPrice(707, new DateTime(2008, 1, 1));
                var productListPrice = uow.ExecuteFunction(sqlFunction);

                Console.WriteLine("Aufruf der SQL Funktion GetProductListPrice ergibt den Wert: {0}", productListPrice);
            }

            Console.ReadLine();
        }
开发者ID:srasch,项目名称:MyCleanEntityFramework,代码行数:29,代码来源:Program.cs


示例10: OnStartup

        /// <summary>
        /// Raises the <see cref="E:System.Windows.Application.Startup" /> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.StartupEventArgs" /> that contains the event data.</param>
        protected override void OnStartup(System.Windows.StartupEventArgs e)
        {
            var bootstrapper = new Bootstrapper();
            bootstrapper.RunWithSplashScreen<ProgressNotifyableViewModel>();

            base.OnStartup(e);
        }
开发者ID:Catel,项目名称:Catel.LogAnalyzer,代码行数:11,代码来源:App.xaml.cs


示例11: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var bstrap = new Bootstrapper();
            bstrap.Run();
        }
开发者ID:Khayde,项目名称:slimCat,代码行数:7,代码来源:App.xaml.cs


示例12: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var bootstrapper = new Bootstrapper();
            var shellView = bootstrapper.Bootstrap();

            var bus = bootstrapper.Resolve<IMessageBus>();

            bus.RegisterMessageSource(this.GetActivated().Select(_ => new ApplicationActivatedMessage()));
            bus.RegisterMessageSource(this.GetDeactivated().Select(_ => new ApplicationDeactivatedMessage()));

            shellView.Window.Show();

            MainWindow = shellView.Window;
            ShutdownMode = ShutdownMode.OnMainWindowClose;

            var toastWindow = bootstrapper.Resolve<IToastWindow>();
            toastWindow.Window.Show();

            //int i = 1;
            //bus.RegisterMessageSource(Observable.Interval(TimeSpan.FromSeconds(3)).Select(_ => i++)
            //    .Take(100).Select(num => new ShowToastMessage(
            //    new NotificationMessage(
            //        new Room { Name = "Ohai " + num },
            //        new User { Name = "Arild" },
            //        new Message { Body = "Ohai thar " + num, MessageTypeString = MessageType.TextMessage.ToString() }),
            //        new ShowToastNotificationAction())));
        }
开发者ID:Doomblaster,项目名称:MetroFire,代码行数:29,代码来源:App.xaml.cs


示例13: OnStartup

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            if (e.Args.Any(item => string.Equals(item, "Integrate", StringComparison.InvariantCultureIgnoreCase)))
            {
                RegistryHelper.Integrate();
                Environment.Exit(1);
            }
            if (e.Args.Any(item => string.Equals(item, "Desintegrate", StringComparison.InvariantCultureIgnoreCase)))
            {
                RegistryHelper.Desintegrate();
                Environment.Exit(1);
            }

            #if DEBUG
            BindingErrorListener.Listen(m => MessageBox.Show(m));
            #endif
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            ApplicationService.Closing += new System.ComponentModel.CancelEventHandler(ApplicationService_Closing);

            _bootstrapper = new Bootstrapper();
            using (new DoubleLaunchLocker(SignalId, WaitId))
                _bootstrapper.Initialize();
        }
开发者ID:hjlfmy,项目名称:Rubezh,代码行数:25,代码来源:App.xaml.cs


示例14: Startup

 public Startup(IObjectContainer objectContainer)
 {
     var containerAdapter = new ObjectContainerAdapter(objectContainer);
     var bootstrapper =
         new Bootstrapper(containerAdapter)
         .Use(new RegisterCompositionModulesMiddleware<Bootstrapper>());            
     bootstrapper.Initialize();            
 }                       
开发者ID:LogoFX,项目名称:Samples.Specifications,代码行数:8,代码来源:Startup.cs


示例15: ExpectAsyncNamedRouteIsResolvedCorrectlyByService

		public void ExpectAsyncNamedRouteIsResolvedCorrectlyByService(RouteRegistrar registrar, Guid token)
		{
			using (var bootstrapper = new Bootstrapper())
			{
				var browser = new Browser(bootstrapper);
				browser.Get<NamedRouteResponse>("/named/async/" + token).Uri.Should().Be("/some-named-async-route/" + token);
			}
		}
开发者ID:serenata-evaldas,项目名称:Nancy.ServiceRouting,代码行数:8,代码来源:NamedRouteTest.cs


示例16: VisualStudioPackageBootstrapper

 public VisualStudioPackageBootstrapper(Package package)
 {
     _boot = new Bootstrapper(new List<INinjectModule>() {
         new InfrastructureModule(),
         new ViewsModule(),
         new VisualMutatorModule(),
         new VSNinjectModule(new VisualStudioConnection(package))});
 }
开发者ID:Refresh06,项目名称:visualmutator,代码行数:8,代码来源:VisualStudioPackageBootstrapper.cs


示例17: InitIocContainer

        private void InitIocContainer()
        {
            var bootstrapper = new Bootstrapper();
            bootstrapper.PreInitializeEvent += (o, s) => PreInitialize();
            bootstrapper.PostInitializeEvent += (o, s) => PostInitialize();

            bootstrapper.OnInitialize();
        }
开发者ID:yangganggood,项目名称:EMP,代码行数:8,代码来源:UnitTestBase.cs


示例18: StaticHtmlModule

        public StaticHtmlModule(Bootstrapper straps)
        {
            _basePath = Path.Combine(straps.RootPath.FullName, "wwwroot");

            Get["/"] = _ => GetStaticIfAvailable();

            Get["{path*}"] = _ => GetStaticIfAvailable(_.path);
        }
开发者ID:duhaly,项目名称:Nancy-vNext5,代码行数:8,代码来源:StaticHtmlModule.cs


示例19: Vsc14Package

        /// <summary>
        /// Initializes a new instance of the <see cref="Vsc14Package"/> class.
        /// </summary>
        public Vsc14Package()
        {
            // Inside this method you can place any initialization code that does not require
            // any Visual Studio service because at this point the package object is created but
            // not sited yet inside Visual Studio environment. The place to do all the other
            // initialization is the Initialize method.

            Bootstrapper = new Bootstrapper();
        }
开发者ID:gandarez,项目名称:VSCommands,代码行数:12,代码来源:Vsc14Package.cs


示例20: BootstrapsApplicationWhenRun

        public void BootstrapsApplicationWhenRun()
        {
            var app = new App();
            var bootsrapper = new Bootstrapper(app);
            bootsrapper.Run();

            Assert.That(app.MainPage, Is.Not.Null);
            Assert.That(app.MainPage, Is.TypeOf<NavigationPage>());
        }
开发者ID:dj-pgs,项目名称:MountainWeather,代码行数:9,代码来源:BootstrapperFixture.cs



注:本文中的Bootstrapper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Border类代码示例发布时间:2022-05-24
下一篇:
C# BootFX类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap