public static void Start <TService>(ServiceBootstrap <TService> bootstrap) where TService : Service { var metadata = bootstrap.CreateMetadata(); bootstrap.PreConfigureLogger(); bootstrap.ConfigureLogger(); bootstrap.PostConfigureLogger(); bootstrap.PreRegisterDependencies(); bootstrap.RegisterDependencies(); bootstrap.PostRegisterDependencies(); HostFactory.Run(host => { host.UseLibLog(); host.SetDescription(metadata.Description); host.SetServiceName(metadata.Name); host.Service <Service>(service => { service.WhenStarted(s => s.StartAsync().ConfigureAwait(false).GetAwaiter().GetResult()); service.WhenStopped(s => s.StopAsync().ConfigureAwait(false).GetAwaiter().GetResult()); service.ConstructUsing(() => bootstrap.GetServiceAsync().ConfigureAwait(false).GetAwaiter().GetResult()); }); host.StartAutomatically(); }); }
public ServiceBootstrapTest() { var builder = new ContainerBuilder(); ServiceBootstrap.ConfigureContainer(builder); _container = builder.Build(); }
private async void OnSplashScreenDismissed(SplashScreen sender, object args) { sender.Dismissed -= OnSplashScreenDismissed; ServiceBootstrap.Register(ServiceLocator.Current); await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, DoLaunchMainPage).AsTask(); }
protected override void ConfigureContainer(ContainerBuilder builder) { ServiceBootstrap.ConfigureContainer(builder); base.ConfigureContainer(builder); }
public App() { InitializeComponent(); ServiceBootstrap.IncludeMigrations(); }
public Start_service_windows() { _bootstrap = new ServiceBootstrap(BootstrapInCodeConfiguration.Default()); }
public TopshelfHostEntryPoint(ServiceBootstrap bootstrap, ServiceMetadata metadata) { _bootstrap = bootstrap; _metadata = metadata; }