PropertyCollection Class
Namespace: Stride.Core.AssetsAssembly: Stride.Core.Assets.dll
A collection of properties.
[DataContract("PropertyCollection")]
public sealed class PropertyCollection : ConcurrentDictionary<PropertyKey, object>, IDictionary<PropertyKey, object>, ICollection<KeyValuePair<PropertyKey, object>>, IDictionary, ICollection, IReadOnlyDictionary<PropertyKey, object>, IReadOnlyCollection<KeyValuePair<PropertyKey, object>>, IEnumerable<KeyValuePair<PropertyKey, object>>, IEnumerable
Name | Description | |
---|---|---|
Constructors | ||
PropertyCollection() | Initializes a new instance of the PropertyCollection class. |
|
PropertyCollection(IEnumerable<KeyValuePair<PropertyKey, Object>>) | Initializes a new instance of the PropertyCollection class. |
|
Methods | ||
CopyTo(IDictionary<PropertyKey, Object>, Boolean) | Copies this properties to a output dictionary. |
|
Get(PropertyKey) | Gets a value for the specified key, null if not found. |
|
Get<T>(PropertyKey<T>) | Gets a value for the specified key, null if not found. |
|
Set(PropertyKey, Object) | Sets a value for the specified key. |
|
Set<T>(PropertyKey<T>, T) | Sets a value for the specified key. |
|
TryGet<T>(PropertyKey<T>, out T) | Gets a value for the specified key, null if not found. |
Constructors
PropertyCollection()
Initializes a new instance of the PropertyCollection class.
public PropertyCollection()
PropertyCollection(IEnumerable<KeyValuePair<PropertyKey, Object>>)
Initializes a new instance of the PropertyCollection class.
public PropertyCollection(IEnumerable<KeyValuePair<PropertyKey, object>> dictionary)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<PropertyKey, System.Object>> | dictionary | The dictionary. |
Methods
CopyTo(IDictionary<PropertyKey, Object>, Boolean)
Copies this properties to a output dictionary.
public void CopyTo(IDictionary<PropertyKey, object> properties, bool overrideValues)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<PropertyKey, System.Object> | properties | The dictionary to receive a copy of the properties of this instance. |
System.Boolean | overrideValues | if set to |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | properties |
Get(PropertyKey)
Gets a value for the specified key, null if not found.
public object Get(PropertyKey key)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey | key | The key. |
Returns
Type | Description |
---|---|
System.Object | A value for the specified key, null if not found. |
Get<T>(PropertyKey<T>)
Gets a value for the specified key, null if not found.
public T Get<T>(PropertyKey<T> key)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key | The key. |
Returns
Type | Description |
---|---|
T | a value for the specified key, null if not found. |
Type Parameters
Name | Description |
---|---|
T | Type of the value |
Set(PropertyKey, Object)
Sets a value for the specified key.
public void Set(PropertyKey key, object value)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey | key | The key. |
System.Object | value | The value. |
Set<T>(PropertyKey<T>, T)
Sets a value for the specified key.
public void Set<T>(PropertyKey<T> key, T value)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key | The key. |
T | value | The value. |
Type Parameters
Name | Description |
---|---|
T | Type of the value. |
TryGet<T>(PropertyKey<T>, out T)
Gets a value for the specified key, null if not found.
public bool TryGet<T>(PropertyKey<T> key, out T value)
Parameters
Type | Name | Description |
---|---|---|
PropertyKey<T> | key | The key. |
T | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean | A value for the specified key, null if not found. |
Type Parameters
Name | Description |
---|---|
T | Type of the value |