Class NamedValueDictionary<T>
Provides a named value dictionary for use in the Content Pipeline.
public class NamedValueDictionary<T> : IDictionary<string, T>, ICollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerable
Type Parameters
TType of the value stored in the dictionary
- Inheritance
-
NamedValueDictionary<T>
- Implements
-
IDictionary<string, T>
- Derived
- Inherited Members
Constructors
NamedValueDictionary()
Initializes an instance of NamedValueDictionary.
public NamedValueDictionary()
Properties
Count
Gets the number of items in the dictionary.
public int Count { get; }
Property Value
DefaultSerializerType
Specifies the type hint for the intermediate serializer. Values of this type do not store an explicit type attribute in the related XML source.
protected virtual Type DefaultSerializerType { get; }
Property Value
this[string]
Gets or sets the specified item.
public T this[string key] { get; set; }
Parameters
keystringIdentity of a key.
Property Value
- T
Keys
Gets all keys contained in the dictionary.
public ICollection<string> Keys { get; }
Property Value
Values
Gets all values contained in the dictionary.
public ICollection<T> Values { get; }
Property Value
- ICollection<T>
Methods
Add(string, T)
Adds the specified key and value to the dictionary.
public void Add(string key, T value)
Parameters
keystringIdentity of the key of the new data pair.
valueTThe value of the new data pair.
AddItem(string, T)
Adds an element to the dictionary.
protected virtual void AddItem(string key, T value)
Parameters
keystringIdentity of the key of the new element.
valueTThe value of the new element.
Clear()
Removes all keys and values from the dictionary.
public void Clear()
ClearItems()
Removes all elements from the dictionary.
protected virtual void ClearItems()
ContainsKey(string)
Determines whether the specified key is present in the dictionary.
public bool ContainsKey(string key)
Parameters
keystringIdentity of a key.
Returns
GetEnumerator()
Gets an enumerator that iterates through items in a dictionary.
public IEnumerator<KeyValuePair<string, T>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<string, T>>
Enumerator for iterating through the dictionary.
Remove(string)
Removes the specified key and value from the dictionary.
public bool Remove(string key)
Parameters
keystringIdentity of the key to be removed.
Returns
- bool
true if the value is present; false otherwise.
RemoveItem(string)
Removes the specified element from the dictionary.
protected virtual bool RemoveItem(string key)
Parameters
keystringIdentity of the key of the data pair to be removed.
Returns
- bool
true if the value is present; false otherwise.
SetItem(string, T)
Modifies the value of an existing element.
protected virtual void SetItem(string key, T value)
Parameters
keystringIdentity of the element to be modified.
valueTThe value to be set.
TryGetValue(string, out T)
Gets the value associated with the specified key.
public bool TryGetValue(string key, out T value)
Parameters
keystringIdentity of the key of the element whose value is to be retrieved.
valueTThe current value of the element.
Returns
- bool
true if the value is present; false otherwise.