Rename IBlazorApplicationBuilder->IComponentsApplicationBuilder
This commit is contained in:
parent
921c6c16d6
commit
c901cc069d
|
|
@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Components.Builder;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Blazor.Hosting
|
namespace Microsoft.AspNetCore.Blazor.Hosting
|
||||||
{
|
{
|
||||||
internal class WebAssemblyBlazorApplicationBuilder : IBlazorApplicationBuilder
|
internal class WebAssemblyBlazorApplicationBuilder : IComponentsApplicationBuilder
|
||||||
{
|
{
|
||||||
public WebAssemblyBlazorApplicationBuilder(IServiceProvider services)
|
public WebAssemblyBlazorApplicationBuilder(IServiceProvider services)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ namespace Microsoft.AspNetCore.Components.Hosting
|
||||||
{
|
{
|
||||||
public List<object> Arguments { get; } = new List<object>();
|
public List<object> Arguments { get; } = new List<object>();
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app, string foo)
|
public void Configure(IComponentsApplicationBuilder app, string foo)
|
||||||
{
|
{
|
||||||
Arguments.Add(app);
|
Arguments.Add(app);
|
||||||
Arguments.Add(foo);
|
Arguments.Add(foo);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Blazor.Hosting.Test
|
||||||
// Arrange
|
// Arrange
|
||||||
var builder = new WebAssemblyHostBuilder();
|
var builder = new WebAssemblyHostBuilder();
|
||||||
var host = builder.Build();
|
var host = builder.Build();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await host.StartAsync());
|
var ex = await Assert.ThrowsAsync<InvalidOperationException>(async () => await host.StartAsync());
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Blazor.Hosting.Test
|
||||||
{
|
{
|
||||||
public bool ConfigureCalled { get; set; }
|
public bool ConfigureCalled { get; set; }
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app, IServiceProvider services)
|
public void Configure(IComponentsApplicationBuilder app, IServiceProvider services)
|
||||||
{
|
{
|
||||||
ConfigureCalled = true;
|
ConfigureCalled = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace BlazorHosted_CSharp.Client
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<App>("app");
|
app.AddComponent<App>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace BlazorStandalone_CSharp
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<App>("app");
|
app.AddComponent<App>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace HostedInAspNet.Client
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<Home>("app");
|
app.AddComponent<Home>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Blazor.E2EPerformance
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<App>("app");
|
app.AddComponent<App>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace StandaloneApp
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<App>("app");
|
app.AddComponent<App>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,18 @@
|
||||||
namespace Microsoft.AspNetCore.Components.Builder
|
namespace Microsoft.AspNetCore.Components.Builder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides extension methods for <see cref="IBlazorApplicationBuilder"/>.
|
/// Provides extension methods for <see cref="IComponentsApplicationBuilder"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class BlazorApplicationBuilderExtensions
|
public static class ComponentsApplicationBuilderExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Associates the component type with the application,
|
/// Associates the component type with the application,
|
||||||
/// causing it to be displayed in the specified DOM element.
|
/// causing it to be displayed in the specified DOM element.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="app">The <see cref="IBlazorApplicationBuilder"/>.</param>
|
/// <param name="app">The <see cref="IComponentsApplicationBuilder"/>.</param>
|
||||||
/// <typeparam name="TComponent">The type of the component.</typeparam>
|
/// <typeparam name="TComponent">The type of the component.</typeparam>
|
||||||
/// <param name="domElementSelector">A CSS selector that uniquely identifies a DOM element.</param>
|
/// <param name="domElementSelector">A CSS selector that uniquely identifies a DOM element.</param>
|
||||||
public static void AddComponent<TComponent>(this IBlazorApplicationBuilder app, string domElementSelector)
|
public static void AddComponent<TComponent>(this IComponentsApplicationBuilder app, string domElementSelector)
|
||||||
where TComponent : IComponent
|
where TComponent : IComponent
|
||||||
{
|
{
|
||||||
app.AddComponent(typeof(TComponent), domElementSelector);
|
app.AddComponent(typeof(TComponent), domElementSelector);
|
||||||
|
|
@ -6,9 +6,9 @@ using System;
|
||||||
namespace Microsoft.AspNetCore.Components.Builder
|
namespace Microsoft.AspNetCore.Components.Builder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A builder for constructing a Blazor application.
|
/// A builder for adding components to an application.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IBlazorApplicationBuilder
|
public interface IComponentsApplicationBuilder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the application services.
|
/// Gets the application services.
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
namespace Microsoft.AspNetCore.Builder
|
namespace Microsoft.AspNetCore.Builder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Provides configuration options to the <see cref="BlazorApplicationBuilderExtensions.UseBlazor(IApplicationBuilder, BlazorOptions)"/>
|
/// Provides configuration options to the <see cref="ComponentsApplicationBuilderExtensions.UseBlazor(IApplicationBuilder, BlazorOptions)"/>
|
||||||
/// middleware.
|
/// middleware.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class BlazorOptions
|
public class BlazorOptions
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Components.Builder;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Components.Hosting
|
namespace Microsoft.AspNetCore.Components.Hosting
|
||||||
{
|
{
|
||||||
internal class ServerSideBlazorApplicationBuilder : IBlazorApplicationBuilder
|
internal class ServerSideBlazorApplicationBuilder : IComponentsApplicationBuilder
|
||||||
{
|
{
|
||||||
public ServerSideBlazorApplicationBuilder(IServiceProvider services)
|
public ServerSideBlazorApplicationBuilder(IServiceProvider services)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,14 +44,14 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||||
public event UnhandledExceptionEventHandler UnhandledException;
|
public event UnhandledExceptionEventHandler UnhandledException;
|
||||||
|
|
||||||
private bool _isInitialized;
|
private bool _isInitialized;
|
||||||
private Action<IBlazorApplicationBuilder> _configure;
|
private Action<IComponentsApplicationBuilder> _configure;
|
||||||
|
|
||||||
public CircuitHost(
|
public CircuitHost(
|
||||||
IServiceScope scope,
|
IServiceScope scope,
|
||||||
IClientProxy client,
|
IClientProxy client,
|
||||||
RendererRegistry rendererRegistry,
|
RendererRegistry rendererRegistry,
|
||||||
RemoteRenderer renderer,
|
RemoteRenderer renderer,
|
||||||
Action<IBlazorApplicationBuilder> configure,
|
Action<IComponentsApplicationBuilder> configure,
|
||||||
IJSRuntime jsRuntime,
|
IJSRuntime jsRuntime,
|
||||||
CircuitSynchronizationContext synchronizationContext)
|
CircuitSynchronizationContext synchronizationContext)
|
||||||
{
|
{
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||||
public IServiceScope Scope { get; }
|
public IServiceScope Scope { get; }
|
||||||
|
|
||||||
public IServiceProvider Services { get; }
|
public IServiceProvider Services { get; }
|
||||||
|
|
||||||
public CircuitSynchronizationContext SynchronizationContext { get; }
|
public CircuitSynchronizationContext SynchronizationContext { get; }
|
||||||
|
|
||||||
public async Task InitializeAsync()
|
public async Task InitializeAsync()
|
||||||
|
|
@ -116,7 +116,7 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||||
await SynchronizationContext.Invoke(() =>
|
await SynchronizationContext.Invoke(() =>
|
||||||
{
|
{
|
||||||
SetCurrentCircuitHost(this);
|
SetCurrentCircuitHost(this);
|
||||||
|
|
||||||
DotNetDispatcher.BeginInvoke(callId, assemblyName, methodIdentifier, dotNetObjectId, argsJson);
|
DotNetDispatcher.BeginInvoke(callId, assemblyName, methodIdentifier, dotNetObjectId, argsJson);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ namespace Microsoft.AspNetCore.Components.Server.Circuits
|
||||||
{
|
{
|
||||||
// During the DI configuration phase, we use Configure<DefaultCircuitFactoryOptions>(...)
|
// During the DI configuration phase, we use Configure<DefaultCircuitFactoryOptions>(...)
|
||||||
// callbacks to build up this dictionary mapping paths to startup actions
|
// callbacks to build up this dictionary mapping paths to startup actions
|
||||||
public Dictionary<PathString, Action<IBlazorApplicationBuilder>> StartupActions { get; }
|
public Dictionary<PathString, Action<IComponentsApplicationBuilder>> StartupActions { get; }
|
||||||
|
|
||||||
public DefaultCircuitFactoryOptions()
|
public DefaultCircuitFactoryOptions()
|
||||||
{
|
{
|
||||||
StartupActions = new Dictionary<PathString, Action<IBlazorApplicationBuilder>>();
|
StartupActions = new Dictionary<PathString, Action<IComponentsApplicationBuilder>>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Components.Hosting
|
||||||
|
|
||||||
public object Instance { get; }
|
public object Instance { get; }
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app, IServiceProvider services)
|
public void Configure(IComponentsApplicationBuilder app, IServiceProvider services)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Components.Hosting
|
||||||
for (var i = 0; i < parameters.Length; i++)
|
for (var i = 0; i < parameters.Length; i++)
|
||||||
{
|
{
|
||||||
var parameter = parameters[i];
|
var parameter = parameters[i];
|
||||||
arguments[i] = parameter.ParameterType == typeof(IBlazorApplicationBuilder)
|
arguments[i] = parameter.ParameterType == typeof(IComponentsApplicationBuilder)
|
||||||
? app
|
? app
|
||||||
: services.GetRequiredService(parameter.ParameterType);
|
: services.GetRequiredService(parameter.ParameterType);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,6 @@ namespace Microsoft.AspNetCore.Components.Hosting
|
||||||
{
|
{
|
||||||
void ConfigureServices(IServiceCollection services);
|
void ConfigureServices(IServiceCollection services);
|
||||||
|
|
||||||
void Configure(IBlazorApplicationBuilder app, IServiceProvider services);
|
void Configure(IComponentsApplicationBuilder app, IServiceProvider services);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace BasicTestApp
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Create("WEBASSEMBLY")))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace ComponentsApp.App
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<App>("app");
|
app.AddComponent<App>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace RazorComponentsWeb_CSharp.App
|
||||||
services.AddSingleton<WeatherForecastService>();
|
services.AddSingleton<WeatherForecastService>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IBlazorApplicationBuilder app)
|
public void Configure(IComponentsApplicationBuilder app)
|
||||||
{
|
{
|
||||||
app.AddComponent<App>("app");
|
app.AddComponent<App>("app");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue