ConsoleLifetime Sınıf

Tanım

Ctrl+C veya SIGTERM'i dinler ve kapatmayı başlatır.

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
Devralma
ConsoleLifetime
Öznitelikler
Uygulamalar

Açıklamalar

Bu API .NET altyapısını destekler ve doğrudan kodunuzdan kullanılması amaçlanmamıştır.

Oluşturucular

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

Belirtilen konsol ömrü seçeneklerini, konak ortamını, konak seçeneklerini ve günlükçü fabrikasını kullanarak bir ConsoleLifetime örneği başlatır.

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

Belirtilen konsol ömrü seçeneklerini, konak ortamını, konak uygulama ömrü ve konak seçeneklerini kullanarak bir ConsoleLifetime örneği başlatır.

Yöntemler

Name Description
Dispose()

Kapatma işleyicilerinin kaydını kaldırıp uygulama başlatma ve uygulama durdurma kayıtlarını atılır.

StopAsync(CancellationToken)

Bu yöntem hiçbir şey yapmaz.

WaitForStartAsync(CancellationToken)

Bu uygulama için uygulama başlatma, uygulama durdurma ve kapatma işleyicilerini kaydeder.

Şunlara uygulanır