Class LocalizationProviderBuilder
Used to configure and build a LocalizationProvider.
Inheritance
System.Object
LocalizationProviderBuilder
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Framework.Localization
Assembly: EPiServer.Framework.dll
Version: 11.20.7Syntax
public class LocalizationProviderBuilder
Constructors
LocalizationProviderBuilder(String, Type)
Initializes a new instance of the LocalizationProviderBuilder class.
Declaration
public LocalizationProviderBuilder(string name, Type providerType)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
System.Type | providerType |
Properties
Name
Gets the name of the LocalizationProvider.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
ProviderType
Gets the type of the LocalizationProvider.
Declaration
public Type ProviderType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Methods
Build(IServiceLocator)
Builds a new LocalizationProvider instance.
Declaration
public LocalizationProvider Build(IServiceLocator serviceLocator)
Parameters
Type | Name | Description |
---|---|---|
IServiceLocator | serviceLocator | The service locator used to create provider instances. |
Returns
Type | Description |
---|---|
LocalizationProvider | A new LocalizationProvider instance. |
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.Action<TProviderOptions> | configure |
Returns
Type | Description |
---|---|
LocalizationProviderBuilder |
Type Parameters
Name | Description |
---|---|
TProviderOptions |
Create<TProvider>(String)
Factory method for creating a new LocalizationProviderBuilder instance.
Declaration
public static LocalizationProviderBuilder Create<TProvider>(string name = null)
where TProvider : LocalizationProvider
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the localization provider. |
Returns
Type | Description |
---|---|
LocalizationProviderBuilder | A new LocalizationProviderBuilder instance. |
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