Class PropertyContainerClass
Class wrapper around PropertyContainer.
[DataContract]
[DataSerializer(typeof(DictionaryAllSerializer<PropertyContainerClass, PropertyKey, object>))]
public class PropertyContainerClass : IDictionary<PropertyKey, object>, ICollection<KeyValuePair<PropertyKey, object>>, IReadOnlyDictionary<PropertyKey, object>, IReadOnlyCollection<KeyValuePair<PropertyKey, object>>, IEnumerable<KeyValuePair<PropertyKey, object>>, IEnumerable
- Inheritance
-
objectPropertyContainerClass
- Implements
- Extension Methods
Constructors
PropertyContainerClass()
public PropertyContainerClass()
PropertyContainerClass(object)
public PropertyContainerClass(object owner)
Parameters
ownerobject
Properties
Count
Gets the number of elements contained in the ICollection<T>.
public int Count { get; }
Property Value
- int
The number of elements contained in the ICollection<T>.
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
public bool IsReadOnly { get; }
Property Value
- bool
true if the ICollection<T> is read-only; otherwise, false.
this[PropertyKey]
Gets or sets the element with the specified key.
public object this[PropertyKey key] { get; set; }
Parameters
keyPropertyKeyThe key of the element to get or set.
Property Value
- object
The element with the specified key.
Exceptions
- ArgumentNullException
keyis null.- KeyNotFoundException
The property is retrieved and
keyis not found.- NotSupportedException
The property is set and the IDictionary<TKey, TValue> is read-only.
Keys
Gets an ICollection<T> containing the keys of the IDictionary<TKey, TValue>.
public ICollection<PropertyKey> Keys { get; }
Property Value
- ICollection<PropertyKey>
An ICollection<T> containing the keys of the object that implements IDictionary<TKey, TValue>.
Owner
public object Owner { get; }
Property Value
- object
Values
Gets an ICollection<T> containing the values in the IDictionary<TKey, TValue>.
public ICollection<object> Values { get; }
Property Value
- ICollection<object>
An ICollection<T> containing the values in the object that implements IDictionary<TKey, TValue>.
Methods
Add<T>(PropertyKey<T>, T)
public void Add<T>(PropertyKey<T> key, T value)
Parameters
keyPropertyKey<T>valueT
Type Parameters
T
Clear()
Removes all items from the ICollection<T>.
public void Clear()
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
ContainsKey(PropertyKey)
Determines whether the IDictionary<TKey, TValue> contains an element with the specified key.
public bool ContainsKey(PropertyKey key)
Parameters
keyPropertyKeyThe key to locate in the IDictionary<TKey, TValue>.
Returns
- bool
true if the IDictionary<TKey, TValue> contains an element with the key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.
CopyTo(ref PropertyContainer)
public void CopyTo(ref PropertyContainer destination)
Parameters
destinationPropertyContainer
CopyTo(PropertyContainerClass)
public void CopyTo(PropertyContainerClass destination)
Parameters
destinationPropertyContainerClass
Get(PropertyKey)
public object Get(PropertyKey propertyKey)
Parameters
propertyKeyPropertyKey
Returns
- object
GetSafe<T>(PropertyKey<T>)
public T GetSafe<T>(PropertyKey<T> propertyKey)
Parameters
propertyKeyPropertyKey<T>
Returns
- T
Type Parameters
T
Get<T>(PropertyKey<T>)
public T Get<T>(PropertyKey<T> propertyKey)
Parameters
propertyKeyPropertyKey<T>
Returns
- T
Type Parameters
T
Remove(PropertyKey)
Removes the element with the specified key from the IDictionary<TKey, TValue>.
public bool Remove(PropertyKey propertyKey)
Parameters
propertyKeyPropertyKey
Returns
- bool
true if the element is successfully removed; otherwise, false. This method also returns false if
keywas not found in the original IDictionary<TKey, TValue>.
Exceptions
- ArgumentNullException
keyis null.- NotSupportedException
The IDictionary<TKey, TValue> is read-only.
SetObject(PropertyKey, object)
public void SetObject(PropertyKey propertyKey, object tagValue)
Parameters
propertyKeyPropertyKeytagValueobject
Set<T>(PropertyKey<T>, T)
public void Set<T>(PropertyKey<T> propertyKey, T tagValue)
Parameters
propertyKeyPropertyKey<T>tagValueT
Type Parameters
T
TryGetValue(PropertyKey, out object)
Gets the value associated with the specified key.
public bool TryGetValue(PropertyKey propertyKey, out object value)
Parameters
propertyKeyPropertyKeyvalueobjectWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
valueparameter. This parameter is passed uninitialized.
Returns
- bool
true if the object that implements IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.
TryGetValue<T>(PropertyKey<T>, out T)
public bool TryGetValue<T>(PropertyKey<T> propertyKey, out T value)
Parameters
propertyKeyPropertyKey<T>valueT
Returns
Type Parameters
T
Events
PropertyUpdated
public event PropertyContainer.PropertyUpdatedDelegate PropertyUpdated