2026-06-08 02:39:44 +08:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
|
|
|
|
|
|
namespace LanMountainDesktop.AirAppSdk;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2026-08-11 23:03:55 +08:00
|
|
|
/// Core interface for the AirApp entry point.
|
|
|
|
|
/// Implement this interface (or derive from <see cref="AirAppBase"/>) and mark the class
|
|
|
|
|
/// with <see cref="AirAppEntranceAttribute"/> to expose a desktop component or window
|
|
|
|
|
/// AirApp to the LanMountainDesktop host.
|
2026-06-08 02:39:44 +08:00
|
|
|
/// </summary>
|
|
|
|
|
public interface IAirApp
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Initialize the AirApp and register services.
|
|
|
|
|
/// Called during host startup before the application is fully running.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="context">Host builder context</param>
|
|
|
|
|
/// <param name="services">Service collection for dependency injection</param>
|
|
|
|
|
void Initialize(HostBuilderContext context, IServiceCollection services);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called after the host application has started.
|
|
|
|
|
/// Use this for initialization that requires runtime services.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="context">AirApp runtime context</param>
|
|
|
|
|
Task OnStartedAsync(IAirAppRuntimeContext context);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Called when the host application is stopping.
|
|
|
|
|
/// Use this for cleanup and resource disposal.
|
|
|
|
|
/// </summary>
|
|
|
|
|
Task OnStoppingAsync();
|
|
|
|
|
}
|