Class XmlMetadataFile

Namespace
Datamine.MineTrustConnector.Core.ConfigSchemas
Assembly
Datamine.MineTrustConnector.Core.dll

Hierarchical implementation of IMetadataFile which stores the backing config data in XML format. The XML structure is given by hierarchical 'metadata' and 'item' elements, where each metadata element supports multiple items and items can themselves have metadata children. The config values and keys are then given by the 'name' attributes of these elements: <?xml version="1.0" encoding="utf-8"?> <metadata name = " Operation"> <item name = " Geita"> <metadata name = " Pit"> <item name = " Nyankanga"> <metadata name = " Project"> <item name = " Cut 12" /> ...

public class XmlMetadataFile : MetadataFileBase, IMetadataFile
Inheritance
XmlMetadataFile
Implements
Inherited Members

Methods

EnsureSchemaValue(string?, string?)

Ensures that the specified config value is present at the indicated location within the schema

public override void EnsureSchemaValue(string? key, string? value)

Parameters

key string

The key.

value string

The value.

Flatten()

Flattens the backing config data into an enumeration of key value pairs, where the key of each value is its hierarchical location within the schema (in path format)

public override IEnumerable<KeyValuePair<string?, string?>> Flatten()

Returns

IEnumerable<KeyValuePair<string, string>>

The flattened config schema

GetSchemaValues(string?)

Gets the available config values at the indicated location within the schema

public override IEnumerable<string?> GetSchemaValues(string? key)

Parameters

key string

The key.

Returns

IEnumerable<string>

The available values

Load(Stream)

Loads configuration data from the specified content stream.

public override void Load(Stream stream)

Parameters

stream Stream

The stream.

Load(string)

Loads configuration data from the specified file path.

public override void Load(string path)

Parameters

path string

The path.

Rebuild(IEnumerable<KeyValuePair<string?, string?>>)

Rebuilds this instance in its entirety from the specified set of config key value pairs, where the key of each value is its hierarchical location within the schema (in path format). All existing config data stored within this instance is removed.

public override void Rebuild(IEnumerable<KeyValuePair<string?, string?>> keyValuePairs)

Parameters

keyValuePairs IEnumerable<KeyValuePair<string, string>>

The key value pairs.

See Also