private GtkHostBuilderContext GetGtkHostBuilderContext(HostBuilderContext context) { if (!context.Properties.TryGetValue(typeof(GtkHostBuilderContext), out var contextVal)) { var options = new GtkHostOptions(context.Configuration, Assembly.GetEntryAssembly()?.GetName().Name ?? string.Empty); var webHostBuilderContext = new GtkHostBuilderContext { Configuration = context.Configuration, HostingEnvironment = new HostingEnvironment(), }; webHostBuilderContext.HostingEnvironment.Initialize(context.HostingEnvironment.ContentRootPath, options); context.Properties[typeof(GtkHostBuilderContext)] = webHostBuilderContext; context.Properties[typeof(GtkHostOptions)] = options; return(webHostBuilderContext); } // Refresh config, it's periodically updated/replaced var webHostContext = (GtkHostBuilderContext)contextVal; webHostContext.Configuration = context.Configuration; return(webHostContext); }
public void ConfigureAppConfiguration(GtkHostBuilderContext context, IConfigurationBuilder builder) { _configureConfiguration?.Invoke(context, builder); }
public void ConfigureServices(GtkHostBuilderContext context, IServiceCollection services) { _configureServices?.Invoke(context, services); }
public HostServiceProvider(GtkHostBuilderContext context) { _context = context; }