Browse Source

Rename StartBrowserApp-like methods to end with "Async" suffix

pull/10343/head
Max Katz 4 years ago
parent
commit
696c5232e7
  1. 2
      samples/ControlCatalog.Browser.Blazor/Program.cs
  2. 2
      samples/ControlCatalog.Browser/Program.cs
  3. 2
      src/Browser/Avalonia.Browser.Blazor/BlazorSingleViewLifetime.cs
  4. 6
      src/Browser/Avalonia.Browser/BrowserAppBuilder.cs

2
samples/ControlCatalog.Browser.Blazor/Program.cs

@ -19,7 +19,7 @@ public class Program
public static async Task StartAvaloniaApp() public static async Task StartAvaloniaApp()
{ {
await AppBuilder.Configure<ControlCatalog.App>() await AppBuilder.Configure<ControlCatalog.App>()
.StartBlazorApp(); .StartBlazorAppAsync();
} }
public static WebAssemblyHostBuilder CreateHostBuilder(string[] args) public static WebAssemblyHostBuilder CreateHostBuilder(string[] args)

2
samples/ControlCatalog.Browser/Program.cs

@ -17,7 +17,7 @@ internal partial class Program
{ {
ControlCatalog.Pages.EmbedSample.Implementation = new EmbedSampleWeb(); ControlCatalog.Pages.EmbedSample.Implementation = new EmbedSampleWeb();
}) })
.StartBrowserApp("out"); .StartBrowserAppAsync("out");
} }
// Example without a ISingleViewApplicationLifetime // Example without a ISingleViewApplicationLifetime

2
src/Browser/Avalonia.Browser.Blazor/BlazorSingleViewLifetime.cs

@ -15,7 +15,7 @@ public static class BlazorAppBuilder
/// </summary> /// </summary>
/// <param name="builder">Application builder.</param> /// <param name="builder">Application builder.</param>
/// <param name="options">Browser backend specific options.</param> /// <param name="options">Browser backend specific options.</param>
public static async Task StartBlazorApp(this AppBuilder builder, BrowserPlatformOptions? options = null) public static async Task StartBlazorAppAsync(this AppBuilder builder, BrowserPlatformOptions? options = null)
{ {
options ??= new BrowserPlatformOptions(); options ??= new BrowserPlatformOptions();
options.FrameworkAssetPathResolver ??= filePath => $"/_content/Avalonia.Browser.Blazor/{filePath}"; options.FrameworkAssetPathResolver ??= filePath => $"/_content/Avalonia.Browser.Blazor/{filePath}";

6
src/Browser/Avalonia.Browser/BrowserAppBuilder.cs

@ -21,7 +21,7 @@ public static class BrowserAppBuilder
/// <param name="builder">Application builder.</param> /// <param name="builder">Application builder.</param>
/// <param name="mainDivId">ID of the html element where avalonia content should be rendered.</param> /// <param name="mainDivId">ID of the html element where avalonia content should be rendered.</param>
/// <param name="options">Browser backend specific options.</param> /// <param name="options">Browser backend specific options.</param>
public static async Task StartBrowserApp(this AppBuilder builder, string mainDivId, BrowserPlatformOptions? options = null) public static async Task StartBrowserAppAsync(this AppBuilder builder, string mainDivId, BrowserPlatformOptions? options = null)
{ {
if (mainDivId is null) if (mainDivId is null)
{ {
@ -46,9 +46,9 @@ public static class BrowserAppBuilder
/// <param name="options">Browser backend specific options.</param> /// <param name="options">Browser backend specific options.</param>
/// <remarks> /// <remarks>
/// This method doesn't creates any avalonia views to be rendered. To do so create an <see cref="AvaloniaView"/> object. /// This method doesn't creates any avalonia views to be rendered. To do so create an <see cref="AvaloniaView"/> object.
/// Alternatively, you can call <see cref="StartBrowserApp"/> method instead of <see cref="SetupBrowserApp"/>. /// Alternatively, you can call <see cref="StartBrowserAppAsync"/> method instead of <see cref="SetupBrowserAppAsync"/>.
/// </remarks> /// </remarks>
public static async Task SetupBrowserApp(this AppBuilder builder, BrowserPlatformOptions? options = null) public static async Task SetupBrowserAppAsync(this AppBuilder builder, BrowserPlatformOptions? options = null)
{ {
builder = await PreSetupBrowser(builder, options); builder = await PreSetupBrowser(builder, options);

Loading…
Cancel
Save