From c901cc069d644ce9b7a6d93c53895155df3ab276 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Fri, 18 Jan 2019 08:40:57 -0800 Subject: [PATCH] Rename IBlazorApplicationBuilder->IComponentsApplicationBuilder --- .../src/Hosting/WebAssemblyBlazorApplicationBuilder.cs | 2 +- .../Blazor/test/Hosting/ConventionBasedStartupTest.cs | 2 +- .../Blazor/Blazor/test/Hosting/WebAssemblyHostTest.cs | 4 ++-- .../BlazorHosted-CSharp.Client/Startup.cs | 2 +- .../src/content/BlazorStandalone-CSharp/Startup.cs | 2 +- .../Blazor/testassets/HostedInAspNet.Client/Startup.cs | 2 +- .../Microsoft.AspNetCore.Blazor.E2EPerformance/Startup.cs | 2 +- src/Components/Blazor/testassets/StandaloneApp/Startup.cs | 2 +- ...sions.cs => ComponentsApplicationBuilderExtensions.cs} | 8 ++++---- ...icationBuilder.cs => IComponentsApplicationBuilder.cs} | 4 ++-- src/Components/Server/src/BlazorOptions.cs | 2 +- .../src/Builder/ServerSideBlazorApplicationBuilder.cs | 2 +- src/Components/Server/src/Circuits/CircuitHost.cs | 8 ++++---- .../Server/src/Circuits/DefaultCircuitFactoryOptions.cs | 4 ++-- src/Components/Shared/src/ConventionBasedStartup.cs | 4 ++-- src/Components/Shared/src/IBlazorStartup.cs | 2 +- src/Components/test/testassets/BasicTestApp/Startup.cs | 2 +- .../test/testassets/ComponentsApp.App/Startup.cs | 2 +- .../RazorComponentsWeb-CSharp.App/Startup.cs | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) rename src/Components/Components/src/Builder/{BlazorApplicationBuilderExtensions.cs => ComponentsApplicationBuilderExtensions.cs} (68%) rename src/Components/Components/src/Builder/{IBlazorApplicationBuilder.cs => IComponentsApplicationBuilder.cs} (88%) diff --git a/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyBlazorApplicationBuilder.cs b/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyBlazorApplicationBuilder.cs index 1a621c30ab..13d0c70602 100644 --- a/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyBlazorApplicationBuilder.cs +++ b/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyBlazorApplicationBuilder.cs @@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Components.Builder; namespace Microsoft.AspNetCore.Blazor.Hosting { - internal class WebAssemblyBlazorApplicationBuilder : IBlazorApplicationBuilder + internal class WebAssemblyBlazorApplicationBuilder : IComponentsApplicationBuilder { public WebAssemblyBlazorApplicationBuilder(IServiceProvider services) { diff --git a/src/Components/Blazor/Blazor/test/Hosting/ConventionBasedStartupTest.cs b/src/Components/Blazor/Blazor/test/Hosting/ConventionBasedStartupTest.cs index 7815e9a6f6..cbc73b79f8 100644 --- a/src/Components/Blazor/Blazor/test/Hosting/ConventionBasedStartupTest.cs +++ b/src/Components/Blazor/Blazor/test/Hosting/ConventionBasedStartupTest.cs @@ -200,7 +200,7 @@ namespace Microsoft.AspNetCore.Components.Hosting { public List Arguments { get; } = new List(); - public void Configure(IBlazorApplicationBuilder app, string foo) + public void Configure(IComponentsApplicationBuilder app, string foo) { Arguments.Add(app); Arguments.Add(foo); diff --git a/src/Components/Blazor/Blazor/test/Hosting/WebAssemblyHostTest.cs b/src/Components/Blazor/Blazor/test/Hosting/WebAssemblyHostTest.cs index 9aa07b9c69..ce2e831427 100644 --- a/src/Components/Blazor/Blazor/test/Hosting/WebAssemblyHostTest.cs +++ b/src/Components/Blazor/Blazor/test/Hosting/WebAssemblyHostTest.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Blazor.Hosting.Test // Arrange var builder = new WebAssemblyHostBuilder(); var host = builder.Build(); - + // Act var ex = await Assert.ThrowsAsync(async () => await host.StartAsync()); @@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Blazor.Hosting.Test { public bool ConfigureCalled { get; set; } - public void Configure(IBlazorApplicationBuilder app, IServiceProvider services) + public void Configure(IComponentsApplicationBuilder app, IServiceProvider services) { ConfigureCalled = true; } diff --git a/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Startup.cs b/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Startup.cs index af31e12cad..9e39236e4f 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Startup.cs +++ b/src/Components/Blazor/Templates/src/content/BlazorHosted-CSharp/BlazorHosted-CSharp.Client/Startup.cs @@ -9,7 +9,7 @@ namespace BlazorHosted_CSharp.Client { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); } diff --git a/src/Components/Blazor/Templates/src/content/BlazorStandalone-CSharp/Startup.cs b/src/Components/Blazor/Templates/src/content/BlazorStandalone-CSharp/Startup.cs index 2d458060f3..d1a8c8da4e 100644 --- a/src/Components/Blazor/Templates/src/content/BlazorStandalone-CSharp/Startup.cs +++ b/src/Components/Blazor/Templates/src/content/BlazorStandalone-CSharp/Startup.cs @@ -9,7 +9,7 @@ namespace BlazorStandalone_CSharp { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); } diff --git a/src/Components/Blazor/testassets/HostedInAspNet.Client/Startup.cs b/src/Components/Blazor/testassets/HostedInAspNet.Client/Startup.cs index ec33329c95..a06163b9e0 100644 --- a/src/Components/Blazor/testassets/HostedInAspNet.Client/Startup.cs +++ b/src/Components/Blazor/testassets/HostedInAspNet.Client/Startup.cs @@ -12,7 +12,7 @@ namespace HostedInAspNet.Client { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); } diff --git a/src/Components/Blazor/testassets/Microsoft.AspNetCore.Blazor.E2EPerformance/Startup.cs b/src/Components/Blazor/testassets/Microsoft.AspNetCore.Blazor.E2EPerformance/Startup.cs index 415eb21001..7422cd806c 100644 --- a/src/Components/Blazor/testassets/Microsoft.AspNetCore.Blazor.E2EPerformance/Startup.cs +++ b/src/Components/Blazor/testassets/Microsoft.AspNetCore.Blazor.E2EPerformance/Startup.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Blazor.E2EPerformance { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); } diff --git a/src/Components/Blazor/testassets/StandaloneApp/Startup.cs b/src/Components/Blazor/testassets/StandaloneApp/Startup.cs index 55cba92904..79564e8d9d 100644 --- a/src/Components/Blazor/testassets/StandaloneApp/Startup.cs +++ b/src/Components/Blazor/testassets/StandaloneApp/Startup.cs @@ -12,7 +12,7 @@ namespace StandaloneApp { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); } diff --git a/src/Components/Components/src/Builder/BlazorApplicationBuilderExtensions.cs b/src/Components/Components/src/Builder/ComponentsApplicationBuilderExtensions.cs similarity index 68% rename from src/Components/Components/src/Builder/BlazorApplicationBuilderExtensions.cs rename to src/Components/Components/src/Builder/ComponentsApplicationBuilderExtensions.cs index 1185f42d23..66532474c6 100644 --- a/src/Components/Components/src/Builder/BlazorApplicationBuilderExtensions.cs +++ b/src/Components/Components/src/Builder/ComponentsApplicationBuilderExtensions.cs @@ -4,18 +4,18 @@ namespace Microsoft.AspNetCore.Components.Builder { /// - /// Provides extension methods for . + /// Provides extension methods for . /// - public static class BlazorApplicationBuilderExtensions + public static class ComponentsApplicationBuilderExtensions { /// /// Associates the component type with the application, /// causing it to be displayed in the specified DOM element. /// - /// The . + /// The . /// The type of the component. /// A CSS selector that uniquely identifies a DOM element. - public static void AddComponent(this IBlazorApplicationBuilder app, string domElementSelector) + public static void AddComponent(this IComponentsApplicationBuilder app, string domElementSelector) where TComponent : IComponent { app.AddComponent(typeof(TComponent), domElementSelector); diff --git a/src/Components/Components/src/Builder/IBlazorApplicationBuilder.cs b/src/Components/Components/src/Builder/IComponentsApplicationBuilder.cs similarity index 88% rename from src/Components/Components/src/Builder/IBlazorApplicationBuilder.cs rename to src/Components/Components/src/Builder/IComponentsApplicationBuilder.cs index 6d53a3ff32..84806a8769 100644 --- a/src/Components/Components/src/Builder/IBlazorApplicationBuilder.cs +++ b/src/Components/Components/src/Builder/IComponentsApplicationBuilder.cs @@ -6,9 +6,9 @@ using System; namespace Microsoft.AspNetCore.Components.Builder { /// - /// A builder for constructing a Blazor application. + /// A builder for adding components to an application. /// - public interface IBlazorApplicationBuilder + public interface IComponentsApplicationBuilder { /// /// Gets the application services. diff --git a/src/Components/Server/src/BlazorOptions.cs b/src/Components/Server/src/BlazorOptions.cs index 2b60b1a0de..28c346a62f 100644 --- a/src/Components/Server/src/BlazorOptions.cs +++ b/src/Components/Server/src/BlazorOptions.cs @@ -4,7 +4,7 @@ namespace Microsoft.AspNetCore.Builder { /// - /// Provides configuration options to the + /// Provides configuration options to the /// middleware. /// public class BlazorOptions diff --git a/src/Components/Server/src/Builder/ServerSideBlazorApplicationBuilder.cs b/src/Components/Server/src/Builder/ServerSideBlazorApplicationBuilder.cs index d774f0fe65..3cf0807fb3 100644 --- a/src/Components/Server/src/Builder/ServerSideBlazorApplicationBuilder.cs +++ b/src/Components/Server/src/Builder/ServerSideBlazorApplicationBuilder.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Components.Builder; namespace Microsoft.AspNetCore.Components.Hosting { - internal class ServerSideBlazorApplicationBuilder : IBlazorApplicationBuilder + internal class ServerSideBlazorApplicationBuilder : IComponentsApplicationBuilder { public ServerSideBlazorApplicationBuilder(IServiceProvider services) { diff --git a/src/Components/Server/src/Circuits/CircuitHost.cs b/src/Components/Server/src/Circuits/CircuitHost.cs index ea62df438c..20bc7e6a21 100644 --- a/src/Components/Server/src/Circuits/CircuitHost.cs +++ b/src/Components/Server/src/Circuits/CircuitHost.cs @@ -44,14 +44,14 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits public event UnhandledExceptionEventHandler UnhandledException; private bool _isInitialized; - private Action _configure; + private Action _configure; public CircuitHost( IServiceScope scope, IClientProxy client, RendererRegistry rendererRegistry, RemoteRenderer renderer, - Action configure, + Action configure, IJSRuntime jsRuntime, CircuitSynchronizationContext synchronizationContext) { @@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits public IServiceScope Scope { get; } public IServiceProvider Services { get; } - + public CircuitSynchronizationContext SynchronizationContext { get; } public async Task InitializeAsync() @@ -116,7 +116,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits await SynchronizationContext.Invoke(() => { SetCurrentCircuitHost(this); - + DotNetDispatcher.BeginInvoke(callId, assemblyName, methodIdentifier, dotNetObjectId, argsJson); }); } diff --git a/src/Components/Server/src/Circuits/DefaultCircuitFactoryOptions.cs b/src/Components/Server/src/Circuits/DefaultCircuitFactoryOptions.cs index 11852b4032..6d7bf1178e 100644 --- a/src/Components/Server/src/Circuits/DefaultCircuitFactoryOptions.cs +++ b/src/Components/Server/src/Circuits/DefaultCircuitFactoryOptions.cs @@ -12,11 +12,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits { // During the DI configuration phase, we use Configure(...) // callbacks to build up this dictionary mapping paths to startup actions - public Dictionary> StartupActions { get; } + public Dictionary> StartupActions { get; } public DefaultCircuitFactoryOptions() { - StartupActions = new Dictionary>(); + StartupActions = new Dictionary>(); } } } diff --git a/src/Components/Shared/src/ConventionBasedStartup.cs b/src/Components/Shared/src/ConventionBasedStartup.cs index e8e7d79139..4afc211d4b 100644 --- a/src/Components/Shared/src/ConventionBasedStartup.cs +++ b/src/Components/Shared/src/ConventionBasedStartup.cs @@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Components.Hosting public object Instance { get; } - public void Configure(IBlazorApplicationBuilder app, IServiceProvider services) + public void Configure(IComponentsApplicationBuilder app, IServiceProvider services) { try { @@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Components.Hosting for (var i = 0; i < parameters.Length; i++) { var parameter = parameters[i]; - arguments[i] = parameter.ParameterType == typeof(IBlazorApplicationBuilder) + arguments[i] = parameter.ParameterType == typeof(IComponentsApplicationBuilder) ? app : services.GetRequiredService(parameter.ParameterType); } diff --git a/src/Components/Shared/src/IBlazorStartup.cs b/src/Components/Shared/src/IBlazorStartup.cs index 7277c727e0..3f6d71d16e 100644 --- a/src/Components/Shared/src/IBlazorStartup.cs +++ b/src/Components/Shared/src/IBlazorStartup.cs @@ -11,6 +11,6 @@ namespace Microsoft.AspNetCore.Components.Hosting { void ConfigureServices(IServiceCollection services); - void Configure(IBlazorApplicationBuilder app, IServiceProvider services); + void Configure(IComponentsApplicationBuilder app, IServiceProvider services); } } diff --git a/src/Components/test/testassets/BasicTestApp/Startup.cs b/src/Components/test/testassets/BasicTestApp/Startup.cs index 97360471e6..35e5ca921f 100644 --- a/src/Components/test/testassets/BasicTestApp/Startup.cs +++ b/src/Components/test/testassets/BasicTestApp/Startup.cs @@ -16,7 +16,7 @@ namespace BasicTestApp { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY"))) { diff --git a/src/Components/test/testassets/ComponentsApp.App/Startup.cs b/src/Components/test/testassets/ComponentsApp.App/Startup.cs index 0ff0878bf2..f896ae6b28 100644 --- a/src/Components/test/testassets/ComponentsApp.App/Startup.cs +++ b/src/Components/test/testassets/ComponentsApp.App/Startup.cs @@ -12,7 +12,7 @@ namespace ComponentsApp.App { } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); } diff --git a/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Startup.cs b/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Startup.cs index bc32769813..1220b4fa7f 100644 --- a/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Startup.cs +++ b/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/RazorComponentsWeb-CSharp/RazorComponentsWeb-CSharp.App/Startup.cs @@ -12,7 +12,7 @@ namespace RazorComponentsWeb_CSharp.App services.AddSingleton(); } - public void Configure(IBlazorApplicationBuilder app) + public void Configure(IComponentsApplicationBuilder app) { app.AddComponent("app"); }