Browse Source

Renamed typeparam to fix build

pull/708/head
Wiesław Šoltés 10 years ago
parent
commit
8b035ffb2b
  1. 39
      src/Avalonia.Controls/AppBuilder.cs

39
src/Avalonia.Controls/AppBuilder.cs

@ -10,7 +10,8 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Initializes up platform-specific services for an <see cref="Application"/>. /// Initializes up platform-specific services for an <see cref="Application"/>.
/// </summary> /// </summary>
public abstract class AppBuilderBase<AppBuilder> where AppBuilder : AppBuilderBase<AppBuilder>, new() /// <typeparam name="TAppBuilder"></typeparam>
public abstract class AppBuilderBase<TAppBuilder> where TAppBuilder : AppBuilderBase<TAppBuilder>, new()
{ {
/// <summary> /// <summary>
/// Gets or sets the <see cref="IRuntimePlatform"/> instance. /// Gets or sets the <see cref="IRuntimePlatform"/> instance.
@ -41,7 +42,7 @@ namespace Avalonia.Controls
/// Gets or sets a method to call before <see cref="Start{TMainWindow}"/> is called on the /// Gets or sets a method to call before <see cref="Start{TMainWindow}"/> is called on the
/// <see cref="Application"/>. /// <see cref="Application"/>.
/// </summary> /// </summary>
public Action<AppBuilder> BeforeStartCallback { get; set; } public Action<TAppBuilder> BeforeStartCallback { get; set; }
protected AppBuilderBase(IRuntimePlatform platform, Action platformSevices) protected AppBuilderBase(IRuntimePlatform platform, Action platformSevices)
{ {
@ -53,8 +54,8 @@ namespace Avalonia.Controls
/// Begin configuring an <see cref="Application"/>. /// Begin configuring an <see cref="Application"/>.
/// </summary> /// </summary>
/// <typeparam name="TApp">The subclass of <see cref="Application"/> to configure.</typeparam> /// <typeparam name="TApp">The subclass of <see cref="Application"/> to configure.</typeparam>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public static AppBuilder Configure<TApp>() public static TAppBuilder Configure<TApp>()
where TApp : Application, new() where TApp : Application, new()
{ {
return Configure(new TApp()); return Configure(new TApp());
@ -63,26 +64,26 @@ namespace Avalonia.Controls
/// <summary> /// <summary>
/// Begin configuring an <see cref="Application"/>. /// Begin configuring an <see cref="Application"/>.
/// </summary> /// </summary>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public static AppBuilder Configure(Application app) public static TAppBuilder Configure(Application app)
{ {
AvaloniaLocator.CurrentMutable.BindToSelf(app); AvaloniaLocator.CurrentMutable.BindToSelf(app);
return new AppBuilder() return new TAppBuilder()
{ {
Instance = app, Instance = app,
}; };
} }
protected AppBuilder Self => (AppBuilder) this; protected TAppBuilder Self => (TAppBuilder) this;
/// <summary> /// <summary>
/// Registers a callback to call before <see cref="Start{TMainWindow}"/> is called on the /// Registers a callback to call before <see cref="Start{TMainWindow}"/> is called on the
/// <see cref="Application"/>. /// <see cref="Application"/>.
/// </summary> /// </summary>
/// <param name="callback">The callback.</param> /// <param name="callback">The callback.</param>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public AppBuilder BeforeStarting(Action<AppBuilder> callback) public TAppBuilder BeforeStarting(Action<TAppBuilder> callback)
{ {
BeforeStartCallback = callback; BeforeStartCallback = callback;
return Self; return Self;
@ -107,7 +108,7 @@ namespace Avalonia.Controls
/// Sets up the platform-specific services for the application, but does not run it. /// Sets up the platform-specific services for the application, but does not run it.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public AppBuilder SetupWithoutStarting() public TAppBuilder SetupWithoutStarting()
{ {
Setup(); Setup();
return Self; return Self;
@ -117,8 +118,8 @@ namespace Avalonia.Controls
/// Specifies a windowing subsystem to use. /// Specifies a windowing subsystem to use.
/// </summary> /// </summary>
/// <param name="initializer">The method to call to initialize the windowing subsystem.</param> /// <param name="initializer">The method to call to initialize the windowing subsystem.</param>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public AppBuilder UseWindowingSubsystem(Action initializer) public TAppBuilder UseWindowingSubsystem(Action initializer)
{ {
WindowingSubsystem = initializer; WindowingSubsystem = initializer;
return Self; return Self;
@ -128,15 +129,15 @@ namespace Avalonia.Controls
/// Specifies a windowing subsystem to use. /// Specifies a windowing subsystem to use.
/// </summary> /// </summary>
/// <param name="dll">The dll in which to look for subsystem.</param> /// <param name="dll">The dll in which to look for subsystem.</param>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public AppBuilder UseWindowingSubsystem(string dll) => UseWindowingSubsystem(GetInitializer(dll)); public TAppBuilder UseWindowingSubsystem(string dll) => UseWindowingSubsystem(GetInitializer(dll));
/// <summary> /// <summary>
/// Specifies a rendering subsystem to use. /// Specifies a rendering subsystem to use.
/// </summary> /// </summary>
/// <param name="initializer">The method to call to initialize the rendering subsystem.</param> /// <param name="initializer">The method to call to initialize the rendering subsystem.</param>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public AppBuilder UseRenderingSubsystem(Action initializer) public TAppBuilder UseRenderingSubsystem(Action initializer)
{ {
RenderingSubsystem = initializer; RenderingSubsystem = initializer;
return Self; return Self;
@ -146,8 +147,8 @@ namespace Avalonia.Controls
/// Specifies a rendering subsystem to use. /// Specifies a rendering subsystem to use.
/// </summary> /// </summary>
/// <param name="dll">The dll in which to look for subsystem.</param> /// <param name="dll">The dll in which to look for subsystem.</param>
/// <returns>An <see cref="AppBuilder"/> instance.</returns> /// <returns>An <typeparamref name="TAppBuilder"/> instance.</returns>
public AppBuilder UseRenderingSubsystem(string dll) => UseRenderingSubsystem(GetInitializer(dll)); public TAppBuilder UseRenderingSubsystem(string dll) => UseRenderingSubsystem(GetInitializer(dll));
static Action GetInitializer(string assemblyName) => () => static Action GetInitializer(string assemblyName) => () =>
{ {

Loading…
Cancel
Save