Interface IMetaDataContainer
Common interface implemented by objects that have the capability to hold metadata in the form of string key/value pairs.
Namespace: Sdl.FileTypeSupport.Framework.NativeApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public interface IMetaDataContainer
Remarks
Similar to a dictionary<String, String>.
Enumerate existing values through the MetaData property. Add new values, or overwrite existing ones by calling SetMetaData(String, String). Removes values by calling RemoveMetaData(String) or ClearMetaData().
Properties
HasMetaData
True
if there is any metadata in the container
Declaration
bool HasMetaData { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
MetaData
Enumerator for the metadata key/value pairs.
Declaration
IEnumerable<KeyValuePair<string, string>> MetaData { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>> |
Remarks
The returned key value pair should not be modified. Use SetMetaData(String, String) and RemoveMetaData(String) to modify the meta data content.
MetaDataCount
The number of meta data key/value pairs in the container
Declaration
int MetaDataCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ClearMetaData()
Removes all key/value pairs from the meta data collection.
Declaration
void ClearMetaData()
GetMetaData(String)
Returns the metadata value associated with the specified key,
or null
if no such key exists in the collection.
Declaration
string GetMetaData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Must not be empty or |
Returns
Type | Description |
---|---|
System.String | The corresponding value, or |
MetaDataContainsKey(String)
True
if a metadata value with the specified key exists
Declaration
bool MetaDataContainsKey(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Must not be empty or |
Returns
Type | Description |
---|---|
System.Boolean |
RemoveMetaData(String)
Removes the metadata key/value pair with the specified key from the collection. No changes are made if the collection does not contain such a key.
Declaration
bool RemoveMetaData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Must not be |
Returns
Type | Description |
---|---|
System.Boolean |
|
SetMetaData(String, String)
Sets the value of the specified metadata key.
If the key already exists in the collection, its value gets overwritten.
Declaration
void SetMetaData(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Must not be empty or |
System.String | value | Must not be |