Table of Contents

Class XmlConfigurationProvider

Namespace
Dynamicweb.Configuration.Xml
Assembly
Dynamicweb.Core.dll

Reads and writes xml configuration files.

public class XmlConfigurationProvider : IConfigurationProvider
Inheritance
XmlConfigurationProvider
Implements
Inherited Members

Constructors

XmlConfigurationProvider(string)

Creates a new instance of the xml configuration provider.

public XmlConfigurationProvider(string fullPath)

Parameters

fullPath string

Absolute path to an xml configuration file.

XmlConfigurationProvider(XmlDocument)

Loads the data from the provided xml document

public XmlConfigurationProvider(XmlDocument document)

Parameters

document XmlDocument

Properties

Path

Gets the path to the configuration file.

public string? Path { get; }

Property Value

string

Methods

Contains(string)

Determines whether the configuration contains an entry with the specified key.

public bool Contains(string key)

Parameters

key string

The key to locate in the configuration.

Returns

bool

true if the configuration contains the specified configuration key; otherwise, false.

GetKeys()

Gets all keys that can be used to get or set data.

public ICollection<string> GetKeys()

Returns

ICollection<string>

keys

Persist()

Saves the configuration data to an xml file.

public void Persist()

Reload()

Reloads the configuration data from file.

public void Reload()

SetValue(string, string)

Sets the value of an entry with the specified key.

public void SetValue(string key, string value)

Parameters

key string

The key of the entry to set a value for.

value string

A string that represents the value of an entry.

TryGet(string, out string?)

Attempts to get the value associated with the specified key.

public bool TryGet(string key, out string? value)

Parameters

key string

Key of the value to get.

value string

When this method returns, contains the value associated with the specified key, or null if the operation failed.

Returns

bool

true if the specified key was found; otherwise, false.

To top