Interface IMetaDataContainer
Common interface implemented by objects that have the capability to hold metadata in the form of string key/value pairs.
Namespace: SdlSdl.FileTypeSupportFrameworkNativeApi
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 |
---|---|
bool |
MetaData
Enumerator for the metadata key/value pairs.
Declaration
IEnumerable<KeyValuePair<string, string>> MetaData { get; }
Property Value
Type | Description |
---|---|
IEnumerableKeyValuePairstringstring |
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 |
---|---|
int |
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 |
---|---|---|
string | key | Must not be empty or |
Returns
Type | Description |
---|---|
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 |
---|---|---|
string | key | Must not be empty or |
Returns
Type | Description |
---|---|
bool |
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 |
---|---|---|
string | key | Must not be |
Returns
Type | Description |
---|---|
bool |
|
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 |
---|---|---|
string | key | Must not be empty or |
string | value | Must not be |