/// <summary> /// 在应用程序由最终用户正常启动时进行调用。 /// 将在启动应用程序以打开特定文件等情况下使用。 /// </summary> /// <param name="e">有关启动请求和过程的详细信息。</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { if (!Bootstraper.IsInitialized) { Bootstraper.InitializeFromAssemblyNames ( Array.Empty <string>(), "Sakuno.ING.Data", "Sakuno.ING.Data.UWP", "Sakuno.ING.Game.Models", "Sakuno.ING.Game.Provider", "Sakuno.ING.Settings.Common", "Sakuno.ING.Timing.NTP", "Sakuno.ING.UWP.Bridge.Listener", "Sakuno.ING.Views.UWP.ApiDebug", "Sakuno.ING.Views.UWP.MasterData", "Sakuno.ING.Views.UWP.Settings" ); } if (e.PrelaunchActivated == false) { var initialScreen = new Grid(); initialScreen.Loaded += (_, __) => Bootstraper.Startup(); CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = false; Window.Current.Content = initialScreen; Window.Current.Activate(); } }
public static void Main(string[] args) { Directory.CreateDirectory("data"); Bootstraper.InitializeFromAssemblyNames ( Array.Empty <string>(), "Sakuno.ING.Browser.Desktop", "Sakuno.ING.Browser.Desktop.Cef", "Sakuno.ING.Core.Listener", "Sakuno.ING.Data", "Sakuno.ING.Data.Desktop", "Sakuno.ING.Localization.Embed", "Sakuno.ING.Game.Logger", "Sakuno.ING.Game.Logger.Migrators", "Sakuno.ING.Game.Models", "Sakuno.ING.Game.Provider", "Sakuno.ING.Settings.Common", "Sakuno.ING.Shell.Desktop", "Sakuno.ING.Timing.NTP", "Sakuno.ING.ViewModels", "Sakuno.ING.Views.Desktop", "Sakuno.ING.Views.Desktop.Base", "Sakuno.ING.Views.Desktop.Common" ); Bootstraper.Startup(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); string connectionString = Configuration["ConnectionString:Default"]; services.AddDbContext <ApplicationDbContext> (options => options.UseSqlServer(connectionString)); services.AddHangfire(config => { config.UseSqlServerStorage(connectionString); }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddTransient <IJob, Job>(); JobStorage.Current = new SqlServerStorage(connectionString); Bootstraper.InitializeJobs(); }
public void ConfigureServices(IServiceCollection services) { Bootstraper.RegisterServices(services, Configuration); services.Configure <CookiePolicyOptions>(options => { options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); services.AddDbContext <ApplicationDbContext>(options => options.UseSqlServer( Configuration.GetConnectionString("DefaultConnection"), a => a.MigrationsAssembly("Masterchef.Web"))); services.AddDbContext <MasterchefContext>(options => options.UseSqlServer( Configuration.GetConnectionString("DefaultConnection"), a => a.MigrationsAssembly("Masterchef.Web"))); services.AddDefaultIdentity <IdentityUser>() .AddDefaultUI(UIFramework.Bootstrap4) .AddEntityFrameworkStores <ApplicationDbContext>(); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); }
static void Main(string[] args) { Bootstraper.BuildUnityContainer(); var config = new LoggingConfiguration(); var fileTarget = new FileTarget() { Name = "Default", FileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.txt"), Layout = "${date} ${message} ${onexception:inner=${exception:format=toString}}" }; config.AddTarget(fileTarget); config.AddRuleForAllLevels(fileTarget); HostFactory.Run(conf => { conf.Service <IMergePagesClient>(s => { s.ConstructUsing(Bootstraper.Resolve <IMergePagesClient>); s.WhenStarted(x => x.Start()); s.WhenStopped(x => x.Stop()); }).UseNLog(new LogFactory(config)); conf.SetServiceName("Image Merge Client"); conf.SetDisplayName("Merge Service"); conf.SetDescription("Service for merging images into pdf. Client Side"); conf.StartAutomaticallyDelayed(); conf.RunAsLocalSystem(); }); }
public static void Configure(IServiceCollection services) { //foreach (var type in IoC.Module.GetSingleTypes()) // services.AddScoped(type); Bootstraper.Configure(services); }
private static int Main(string[] args) { GlobalContext.Properties["applicationName"] = "UberDeployer.ConsoleApp"; XmlConfigurator.Configure(); TextWriter outputWriter = Console.Out; try { Bootstraper.Bootstrap(); var commandDispatcher = new CommandDispatcher(outputWriter); commandDispatcher.DiscoverCommands(Assembly.GetExecutingAssembly()); if (args.Length == 0) { commandDispatcher.DisplayAvailableCommands(); return(1); } return(commandDispatcher.Dispatch(args)); } catch (Exception exc) { outputWriter.WriteLine(exc); return(1); } }
public ViewModelLocator() { if (_bootstraper == null) { _bootstraper = new Bootstraper(); } }
public void ConfigureServices(IServiceCollection services) { Bootstraper.RegisterServices(services, Configuration); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.AddSwagger(new SwaggerSettings { MainVersion = "v1", Version = "v1.0.0.0", Title = "Masterchef", ContactEmail = "*****@*****.**", ContactName = "Rodrigo Oliveira", ContactUrl = "http://fiap.com.br" }); services.AddCompression(CompressionLevel.Optimal); services.AddDbContext <MasterchefContext>(options => options.UseSqlServer( Configuration.GetConnectionString("DefaultConnection"), a => a.MigrationsAssembly("Masterchef.Web"))); services.AddJwtAuthentication("r2development@123"); }
protected override void Initialize() { var container = Bootstraper.Start(); _codeGenerator = container.Resolve <ICodeGenerator>(); base.Initialize(); var mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (null != mcs) { // Create the command for the menu item. var menuCommandId = new CommandID(GuidList.guidKnockoutGeneratorCmdSet, (int)PkgCmdIDList.cmdidMyCommand); var menuCodeWindowId = new CommandID(GuidList.guidKnockoutGeneratorCodeWindowCmdSet, (int)PkgCmdIDList.cmdidMyCommand); var codeWindowCommand = new OleMenuCommand(MenuItemCallbackCodeWindow, menuCodeWindowId); codeWindowCommand.BeforeQueryStatus += codeWindowCommand_BeforeQueryStatus; var command = new OleMenuCommand(MenuItemCallback, menuCommandId); command.BeforeQueryStatus += CommandBeforeQueryStatus; mcs.AddCommand(command); mcs.AddCommand(codeWindowCommand); } }
public DefaultRegistry() { Bootstraper.InitializeIoCWithStructuremap(this); // App Services For <IValuesService>().Use <ValuesService>(); }
public App() { var container = Bootstraper.Bootstrap(); // The root page of your application MainPage = container.Resolve <LoginPage>(); }
// This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { // pipe line middlware services IocConfig.Config(services, Configuration); // register services in structure map container return(Bootstraper.Bootstrap(services, settings)); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Bootstraper.Run(); }
private void Application_Startup(object sender, StartupEventArgs e) { var bootstrapper = new Bootstraper(); var conatiner = bootstrapper.Bootstrap(); var mainwindow = conatiner.Resolve <MainWindow>(); mainwindow.Show(); }
public LogzioTarget() { var bootstraper = new Bootstraper(); bootstraper.Bootstrap(); _shipper = bootstraper.Resolve <IShipper>(); _internalLogger = bootstraper.Resolve <IInternalLogger>(); }
protected override void OnServiceHostsStarting() { bool mockTeamCity = AppSettingsUtils.ReadAppSettingBool("MockTeamCity"); Bootstraper.Bootstrap(mockTeamCity); base.OnServiceHostsStarting(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Bootstraper.Initialise(); }
private void RegisterCustomControllerFactory() { //IControllerFactory factory = new CustomControllerFactory("TripProj.Controllers"); DIContainer diContainer = new DIContainer(); Bootstraper.Configure(diContainer); ControllerBuilder.Current.SetControllerFactory(new DICustomControllerFactory(diContainer)); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc(config => { config.Filters.Add(typeof(ExceptionFilter)); }); services.AddSingleton <IConfiguration>(Configuration); Bootstraper.RegisterWisTDependencies(services); }
private void Application_Startup(object sender, StartupEventArgs e) { var bootstrap = new Bootstraper(); var container = bootstrap.Bootstrap(); var page1 = container.Resolve <Page1>(); this.MainWindow.Content = page1; this.MainWindow.Show(); }
// This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddDbContext <OrdersContext>(options => options.UseInMemoryDatabase("CheckoutDB")); var bootstrapper = new Bootstraper(); ApplicationContainer = bootstrapper.CreateContainer(services); return(new AutofacServiceProvider(ApplicationContainer)); }
protected void Application_Start() { Bootstraper.InitializeLoggingAndDatadog("LightAppServicesFx-Web"); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); }
private static void Register(HttpConfiguration config) { var container = new UnityContainer(); Bootstraper.Register(container); GlobalConfiguration.Configuration.DependencyResolver = new UnityResolver(container); ControllerBuilder.Current.SetControllerFactory(new IocControllerFactory(container)); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); Bootstraper.InitializeServices(services, Configuration); // In production, the React files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/build"; }); }
public void Setup() { _dummy = new LogzioListenerDummy(); _dummy.Start(); var bootstraper = new Bootstraper(); bootstraper.Bootstrap(); _shipper = bootstraper.Resolve <IShipper>(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <AcademyDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("AcademyDbContext"), b => b.MigrationsAssembly("AcademyASPNET"))); var bootstrapper = new Bootstraper(); bootstrapper.Init(); services.AddControllers(); }
public static IContainer Register() { var container = Bootstraper.Initialize <SimpleWebApiModule>(); // ASP.Net Wep.API and ASP.NET MVC use two different IDependencyResolver // (because they designed the Wep.API to not depend on ASP.NET MVC) // More info: http://stackoverflow.com/questions/12276913/mvc-web-api-not-working-with-autofac-integration DependencyResolver.SetResolver(new AutofacDependencyResolver(container)); GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(container); return(container); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var bootstraper = new Bootstraper(); var container = bootstraper.BootstrapContainer(); MainWindow mainWindow = container.Resolve <MainWindow>(); mainWindow.Show(); }
public static void Startup(string[] commandLine, IEnumerable <Package> packages) { Bootstraper.Initialize(commandLine, packages.Select(p => new PackageStartupInfo { Id = p.Id, Version = p.Version, Module = p.IsModulePackage ? p.MainAssembly?.LazyAssembly : null, Dependencies = p.Dependencies.ToDictionary(d => d.Id, d => d.Version, StringComparer.OrdinalIgnoreCase) }), new PackageStorage(ManifestUtil.TargetFrameworks)); Bootstraper.Startup(); }