Class LocalizationProviderBuilder
Used to configure and build a Localization
Inheritance
Namespace: EPiServer.Framework.Localization
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public class LocalizationProviderBuilder : Object
Constructors
LocalizationProviderBuilder(String, Type)
Initializes a new instance of the Localization
Declaration
public LocalizationProviderBuilder(string name, Type providerType)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | |
System. |
providerType |
Properties
Name
Gets the name of the Localization
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System. |
ProviderType
Gets the type of the Localization
Declaration
public Type ProviderType { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
Build(IServiceProvider)
Builds a new Localization
Declaration
public LocalizationProvider Build(IServiceProvider serviceProvider)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceProvider | The service locatprovideror used to create provider instances. |
Returns
Type | Description |
---|---|
Localization |
A new Localization |
Configure<TProviderOptions>(Action<TProviderOptions>)
Adds a configuration of the provider.
Declaration
public LocalizationProviderBuilder Configure<TProviderOptions>(Action<TProviderOptions> configure)
where TProviderOptions : class, new()
Parameters
Type | Name | Description |
---|---|---|
System. |
configure |
Returns
Type | Description |
---|---|
Localization |
Type Parameters
Name | Description |
---|---|
TProviderOptions |
Create<TProvider>(String)
Factory method for creating a new Localization
Declaration
public static LocalizationProviderBuilder Create<TProvider>(string name = null)
where TProvider : LocalizationProvider
Parameters
Type | Name | Description |
---|---|---|
System. |
name | The name of the localization provider. |
Returns
Type | Description |
---|---|
Localization |
A new Localization |
Type Parameters
Name | Description |
---|---|
TProvider | Type of the provider instance. Must implement LocalizationProvider. |
Remarks
If no name is provided, the provider will be assigned a randomly generated name