Table of Contents

Class EventStateStore

Namespace
CMS.Base
Assembly
CMS.Base.dll

Stores state data of an event.

public sealed class EventStateStore
Inheritance
object
EventStateStore
Extension Methods

Constructors

EventStateStore()

public EventStateStore()

Methods

SetValue<TValue>(string, TValue)

Sets value to the state under the key.

public void SetValue<TValue>(string key, TValue value)

Parameters

key string

Key associated with the value.

value TValue

Value to be set.

Type Parameters

TValue

Type of the value.

Remarks

The state allows for passing data between processing handlers if the event is a compound event consisting of multiple associated events (such as before and after events).

Exceptions

ArgumentNullException

Thrown when key is null.

TryGetValue<TValue>(string, out TValue)

Gets value from the state by its key.

public bool TryGetValue<TValue>(string key, out TValue value)

Parameters

key string

Key associated with the value.

value TValue

When the method returns, contains the value associated with the key, or the default value of TValue (if the value is not found).

Returns

bool

Returns true if the value identified by key is found, otherwise returns false.

Type Parameters

TValue

Type of the value.

Remarks

The state allows for passing data between processing handlers if the event is a compound event consisting of multiple associated events (such as before and after events).

Exceptions

ArgumentNullException

Thrown when key is null.

InvalidCastException

Thrown when value for given key exists but its type is incompatible with TValue.