Class FileXmlLocalizationProvider
Extends XmlLocalizationProvider with functionality to load resource files.
Implements
Inherited Members
Namespace: EPiServer.Framework.Localization.XmlResources
Assembly: EPiServer.Framework.AspNetCore.dll
Version: 12.0.3Syntax
public class FileXmlLocalizationProvider : XmlLocalizationProvider, IDisposable
Constructors
FileXmlLocalizationProvider(IFileProvider, IHostEnvironment)
Initializes a new instance of the FileXmlLocalizationProvider class.
Declaration
public FileXmlLocalizationProvider(IFileProvider virtualPathProvider, IHostEnvironment hostingEnvironment)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Extensions.FileProviders.IFileProvider | virtualPathProvider | The virtual path provider. |
| Microsoft.Extensions.Hosting.IHostEnvironment | hostingEnvironment | The hosting environment. |
Fields
FileSystemWatchPathKey
The configKey that should be used if provider should set up a FileSystemWatcher for a physical directory path.
Declaration
public static readonly string FileSystemWatchPathKey
Field Value
| Type | Description |
|---|---|
| System.String |
PhysicalPathKey
The configKey that should be used if provider is to be used with a physical folder.
Declaration
public static readonly string PhysicalPathKey
Field Value
| Type | Description |
|---|---|
| System.String |
VirtualPathKey
The configKey that should be used if provider is to be used with a Microsoft.Extensions.FileProviders.IFileProvider
Declaration
public static readonly string VirtualPathKey
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Releases unmanaged and - optionally - managed resources
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing |
|
Finalize()
Releases unmanaged resources and performs other cleanup operations before the FileXmlLocalizationProvider is reclaimed by garbage collection.
Declaration
protected override void Finalize()
Initialize(String, NameValueCollection)
Reads the resource xml files from the location specified in config values.
Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The friendly name of the provider. |
| System.Collections.Specialized.NameValueCollection | config | A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. |
Overrides
Remarks
If the resource files are served by a Microsoft.Extensions.FileProviders.IFileProvider then the config value must include key 'virtualPath'. If the resource files are located in a physical folder then the config value must include key 'physicalPath'.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | The name of the provider is null. |
| System.ArgumentException | The name of the provider has a length of zero. |
| System.InvalidOperationException | An attempt is made to call System.Configuration.Provider.ProviderBase.Initialize(System.String,System.Collections.Specialized.NameValueCollection) on a provider after the provider has already been initialized. |
| System.Configuration.ConfigurationErrorsException | A required configuration key was missing or faulty. |