ConsoleLifetime Klas

Definitie

Luistert naar Ctrl+C of SIGTERM en start de afsluiting.

public ref class ConsoleLifetime : IDisposable, Microsoft::Extensions::Hosting::IHostLifetime
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public class ConsoleLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
public class ConsoleLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
type ConsoleLifetime = class
    interface IHostLifetime
    interface IDisposable
type ConsoleLifetime = class
    interface IHostLifetime
    interface IDisposable
Public Class ConsoleLifetime
Implements IDisposable, IHostLifetime
Overname
ConsoleLifetime
Kenmerken
Implementeringen

Opmerkingen

Deze API ondersteunt de .NET infrastructuur en is niet bedoeld om rechtstreeks vanuit uw code te worden gebruikt.

Constructors

Name Description
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory)

Initialiseert een ConsoleLifetime exemplaar met behulp van de opgegeven opties voor de levensduur van de console, hostomgeving, hostopties en logger factory.

ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>)

Initialiseert een ConsoleLifetime exemplaar met behulp van de opgegeven opties voor levensduur van de console, hostomgeving, levensduur van de hosttoepassing en hostopties.

Methoden

Name Description
Dispose()

De registratie van de afsluithandlers ongedaan maken en de registraties voor het starten en stoppen van toepassingen verwijderen.

StopAsync(CancellationToken)

Deze methode doet niets.

WaitForStartAsync(CancellationToken)

Registreert de start van de toepassing, de toepassing stopt en afsluithandlers voor deze toepassing.

Van toepassing op