SettingsUnitExtensionsRegisterSettingsUnitPluginTPlugin(IUnityContainer, ReadOnlySpanSettingsUnitDescriptor, ReadOnlySpanSettingsUnitCategoryDescriptor, String, ITypeLifetimeManager) - метод

Registers a settings unit plugin and associates it with one or more settings unit descriptors.

Definition

Пространство имён: Tessa.SettingsUnits
Сборка: Tessa (в Tessa.dll) Версия: 4.2.3+85077ef6104b2e81389e52f8b825d77905da3c54
C#
public static IUnityContainer RegisterSettingsUnitPlugin<TPlugin>(
	this IUnityContainer container,
	ReadOnlySpan<SettingsUnitDescriptor> unitDescriptors,
	ReadOnlySpan<SettingsUnitCategoryDescriptor> categoryDescriptors = default,
	string? pluginID = null,
	ITypeLifetimeManager? typeLifetimeManager = null
)
where TPlugin : class, ISettingsUnitPlugin

Параметры

container  IUnityContainer
unitDescriptors  ReadOnlySpanSettingsUnitDescriptor
A collection of settings unit descriptors that should be handled by the specified plugin. Any descriptors that is not yet registered will be registered automatically, but already registered descriptors will not override their registrations.
categoryDescriptors  ReadOnlySpanSettingsUnitCategoryDescriptor  (Optional)
Optional collection of category descriptors required by the provided unit descriptors. Any descriptors that is not yet registered will be registered automatically, but already registered descriptors will not override their registrations.
pluginID  String  (Optional)
The unique identifier of the plugin. If the value is , then the identifier will be created based on type name.
typeLifetimeManager  ITypeLifetimeManager  (Optional)
Unity-container lifetime manager. If the value is , then ContainerControlledLifetimeManager is used.

Параметры типа

TPlugin
The plugin type must be a concrete class and must be registered in Unity container.

Возвращаемое значение

IUnityContainer
The container for method chaining.

Примечание об использовании

В Visual Basic и C# этот метод можно вызывать как метод экземпляра для любого объекта типа IUnityContainer. При вызове метода для экземпляра следует опускать первый параметр. Дополнительные сведения см. в разделе Методы расширения (Visual Basic) или Методы расширения (Руководство по программированию в C#).

Заметки

The method automatically registers the plugin in the Unity-container if it is not already registered there, using the specified lifetime manager (typeLifetimeManager).

См. также