Bagikan melalui


WindowsServiceLifetime Konstruktor

Definisi

Overload

WindowsServiceLifetime(IHostEnvironment, IHostApplicationLifetime, ILoggerFactory, IOptions<HostOptions>)

Menginisialisasi instans WindowsServiceLifetime baru.

WindowsServiceLifetime(IHostEnvironment, IHostApplicationLifetime, ILoggerFactory, IOptions<HostOptions>, IOptions<WindowsServiceLifetimeOptions>)

Menginisialisasi instans baru kelas WindowsServiceLifetime.

WindowsServiceLifetime(IHostEnvironment, IHostApplicationLifetime, ILoggerFactory, IOptions<HostOptions>)

Sumber:
WindowsServiceLifetime.cs
Sumber:
WindowsServiceLifetime.cs
Sumber:
WindowsServiceLifetime.cs

Menginisialisasi instans WindowsServiceLifetime baru.

public:
 WindowsServiceLifetime(Microsoft::Extensions::Hosting::IHostEnvironment ^ environment, Microsoft::Extensions::Hosting::IHostApplicationLifetime ^ applicationLifetime, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::HostOptions ^> ^ optionsAccessor);
public WindowsServiceLifetime (Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> optionsAccessor);
new Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime : Microsoft.Extensions.Hosting.IHostEnvironment * Microsoft.Extensions.Hosting.IHostApplicationLifetime * Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> -> Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime
Public Sub New (environment As IHostEnvironment, applicationLifetime As IHostApplicationLifetime, loggerFactory As ILoggerFactory, optionsAccessor As IOptions(Of HostOptions))

Parameter

environment
IHostEnvironment

Informasi tentang host.

applicationLifetime
IHostApplicationLifetime

IHostApplicationLifetime yang melacak masa pakai layanan.

loggerFactory
ILoggerFactory

ILoggerFactory digunakan untuk membuat instans pencatat masa pakai.

optionsAccessor
IOptions<HostOptions>

IOptions<TOptions> berisi opsi untuk layanan.

Berlaku untuk

WindowsServiceLifetime(IHostEnvironment, IHostApplicationLifetime, ILoggerFactory, IOptions<HostOptions>, IOptions<WindowsServiceLifetimeOptions>)

Sumber:
WindowsServiceLifetime.cs
Sumber:
WindowsServiceLifetime.cs
Sumber:
WindowsServiceLifetime.cs

Menginisialisasi instans baru kelas WindowsServiceLifetime.

public:
 WindowsServiceLifetime(Microsoft::Extensions::Hosting::IHostEnvironment ^ environment, Microsoft::Extensions::Hosting::IHostApplicationLifetime ^ applicationLifetime, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::HostOptions ^> ^ optionsAccessor, Microsoft::Extensions::Options::IOptions<Microsoft::Extensions::Hosting::WindowsServiceLifetimeOptions ^> ^ windowsServiceOptionsAccessor);
public WindowsServiceLifetime (Microsoft.Extensions.Hosting.IHostEnvironment environment, Microsoft.Extensions.Hosting.IHostApplicationLifetime applicationLifetime, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> optionsAccessor, Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.WindowsServiceLifetimeOptions> windowsServiceOptionsAccessor);
new Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime : Microsoft.Extensions.Hosting.IHostEnvironment * Microsoft.Extensions.Hosting.IHostApplicationLifetime * Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.HostOptions> * Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Hosting.WindowsServiceLifetimeOptions> -> Microsoft.Extensions.Hosting.WindowsServices.WindowsServiceLifetime
Public Sub New (environment As IHostEnvironment, applicationLifetime As IHostApplicationLifetime, loggerFactory As ILoggerFactory, optionsAccessor As IOptions(Of HostOptions), windowsServiceOptionsAccessor As IOptions(Of WindowsServiceLifetimeOptions))

Parameter

environment
IHostEnvironment

Informasi tentang host.

applicationLifetime
IHostApplicationLifetime

IHostApplicationLifetime yang melacak masa pakai layanan.

loggerFactory
ILoggerFactory

ILoggerFactory digunakan untuk membuat instans pencatat masa pakai.

optionsAccessor
IOptions<HostOptions>

IOptions<TOptions> berisi opsi untuk layanan.

windowsServiceOptionsAccessor
IOptions<WindowsServiceLifetimeOptions>

Opsi layanan Windows yang digunakan untuk menemukan nama layanan.

Berlaku untuk