Table of Contents

Class PropertyContainerClass

Namespace
Stride.Core
Assembly
Stride.Core.dll

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
PropertyContainerClass
Implements
Extension Methods

Constructors

PropertyContainerClass()

public PropertyContainerClass()

PropertyContainerClass(object)

public PropertyContainerClass(object owner)

Parameters

owner object

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

key PropertyKey

The key of the element to get or set.

Property Value

object

The element with the specified key.

Exceptions

ArgumentNullException

key is null.

KeyNotFoundException

The property is retrieved and key is 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

key PropertyKey<T>
value T

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

key PropertyKey

The 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

key is null.

CopyTo(ref PropertyContainer)

public void CopyTo(ref PropertyContainer destination)

Parameters

destination PropertyContainer

CopyTo(PropertyContainerClass)

public void CopyTo(PropertyContainerClass destination)

Parameters

destination PropertyContainerClass

Get(PropertyKey)

public object Get(PropertyKey propertyKey)

Parameters

propertyKey PropertyKey

Returns

object

GetSafe<T>(PropertyKey<T>)

public T GetSafe<T>(PropertyKey<T> propertyKey)

Parameters

propertyKey PropertyKey<T>

Returns

T

Type Parameters

T

Get<T>(PropertyKey<T>)

public T Get<T>(PropertyKey<T> propertyKey)

Parameters

propertyKey PropertyKey<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

propertyKey PropertyKey

Returns

bool

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey, TValue>.

Exceptions

ArgumentNullException

key is null.

NotSupportedException

The IDictionary<TKey, TValue> is read-only.

SetObject(PropertyKey, object)

public void SetObject(PropertyKey propertyKey, object tagValue)

Parameters

propertyKey PropertyKey
tagValue object

Set<T>(PropertyKey<T>, T)

public void Set<T>(PropertyKey<T> propertyKey, T tagValue)

Parameters

propertyKey PropertyKey<T>
tagValue T

Type Parameters

T

TryGetValue(PropertyKey, out object)

Gets the value associated with the specified key.

public bool TryGetValue(PropertyKey propertyKey, out object value)

Parameters

propertyKey PropertyKey
value object

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. 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

key is null.

TryGetValue<T>(PropertyKey<T>, out T)

public bool TryGetValue<T>(PropertyKey<T> propertyKey, out T value)

Parameters

propertyKey PropertyKey<T>
value T

Returns

bool

Type Parameters

T

Events

PropertyUpdated

public event PropertyContainer.PropertyUpdatedDelegate PropertyUpdated

Event Type

PropertyContainer.PropertyUpdatedDelegate