From 24ef9874716cb5546e65fabf12c5ffb05533bd3f Mon Sep 17 00:00:00 2001 From: Robert Muehsig Date: Tue, 7 Nov 2017 22:21:52 +0100 Subject: [PATCH] enhanced demo for https://github.com/ElectronNET/Electron.NET/issues/42 --- ElectronNET.WebApp/Startup.cs | 11 ++++++++++- ElectronNET.WebApp/appsettings.json | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ElectronNET.WebApp/Startup.cs b/ElectronNET.WebApp/Startup.cs index ad9a68c..83b01d2 100644 --- a/ElectronNET.WebApp/Startup.cs +++ b/ElectronNET.WebApp/Startup.cs @@ -2,6 +2,7 @@ using ElectronNET.API.Entities; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -9,6 +10,13 @@ namespace ElectronNET.WebApp { public class Startup { + public IConfiguration Configuration { get; } + + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) @@ -36,6 +44,7 @@ namespace ElectronNET.WebApp }); + if(HybridSupport.IsElectronActive) { ElectronBootstrap(); @@ -52,7 +61,7 @@ namespace ElectronNET.WebApp }); browserWindow.OnReadyToShow += () => browserWindow.Show(); - browserWindow.SetTitle("Electron.NET API Demos"); + browserWindow.SetTitle(Configuration["DemoTitleInSettings"] ); } } } diff --git a/ElectronNET.WebApp/appsettings.json b/ElectronNET.WebApp/appsettings.json index 5fff67b..f94192b 100644 --- a/ElectronNET.WebApp/appsettings.json +++ b/ElectronNET.WebApp/appsettings.json @@ -4,5 +4,6 @@ "LogLevel": { "Default": "Warning" } - } + }, + "DemoTitleInSettings": "Electron.NET API Demos" }