ConsoleLifetime Třída

Definice

Naslouchá ctrl+C nebo SIGTERM a inicializuje vypnutí.

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
Dědičnost
ConsoleLifetime
Atributy
Implementuje

Poznámky

Toto rozhraní API podporuje infrastrukturu .NET a není určeno k použití přímo z vašeho kódu.

Konstruktory

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

Inicializuje ConsoleLifetime instanci pomocí zadaných možností životnosti konzoly, hostitelského prostředí, možností hostitele a protokolovací továrny.

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

Inicializuje ConsoleLifetime instanci pomocí zadaných možností životnosti konzoly, hostitelského prostředí, životnosti hostitelské aplikace a možností hostitele.

Metody

Name Description
Dispose()

Zruší registraci obslužných rutin vypnutí a odstraní registraci spuštění aplikace a zastavení aplikace.

StopAsync(CancellationToken)

Tato metoda nic nedělá.

WaitForStartAsync(CancellationToken)

Zaregistruje pro tuto aplikaci obslužné rutiny spuštění aplikace, zastavení a vypnutí aplikace.

Platí pro