ConsoleLifetime Klass

Definition

Lyssnar efter Ctrl+C eller SIGTERM och initierar avstängning.

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
Arv
ConsoleLifetime
Attribut
Implementeringar

Kommentarer

Det här API:et stöder .NET infrastruktur och är inte avsett att användas direkt från koden.

Konstruktorer

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

Initierar en ConsoleLifetime instans med de angivna alternativen för konsolens livslängd, värdmiljö, värdalternativ och loggerfabrik.

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

Initierar en ConsoleLifetime instans med de angivna alternativen för konsolens livslängd, värdmiljö, värdprogramlivslängd och värdalternativ.

Metoder

Name Description
Dispose()

Avregistrerar avstängningshanterare och bortser från registreringar av programstart och programstopp.

StopAsync(CancellationToken)

Den här metoden gör ingenting.

WaitForStartAsync(CancellationToken)

Registrerar programmets start-, programstopp- och avstängningshanterare för det här programmet.

Gäller för