Поделиться через


WindowsServiceLifetime Конструкторы

Определение

Перегрузки

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

Инициализирует новый экземпляр WindowsServiceLifetime.

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

Инициализирует новый экземпляр класса WindowsServiceLifetime.

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

Исходный код:
WindowsServiceLifetime.cs
Исходный код:
WindowsServiceLifetime.cs
Исходный код:
WindowsServiceLifetime.cs

Инициализирует новый экземпляр 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);
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))

Параметры

environment
IHostEnvironment

Сведения о узле.

applicationLifetime
IHostApplicationLifetime

IHostApplicationLifetime, отслеживающий время существования службы.

loggerFactory
ILoggerFactory

ILoggerFactory используется для создания экземпляра средства ведения журнала времени существования.

optionsAccessor
IOptions<HostOptions>

IOptions<TOptions>, содержащий параметры службы.

Применяется к

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

Исходный код:
WindowsServiceLifetime.cs
Исходный код:
WindowsServiceLifetime.cs
Исходный код:
WindowsServiceLifetime.cs

Инициализирует новый экземпляр класса 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))

Параметры

environment
IHostEnvironment

Сведения о узле.

applicationLifetime
IHostApplicationLifetime

IHostApplicationLifetime, отслеживающий время существования службы.

loggerFactory
ILoggerFactory

ILoggerFactory используется для создания экземпляра средства ведения журнала времени существования.

optionsAccessor
IOptions<HostOptions>

IOptions<TOptions>, содержащий параметры службы.

windowsServiceOptionsAccessor
IOptions<WindowsServiceLifetimeOptions>

Параметры службы Windows, используемые для поиска имени службы.

Применяется к