Photon Plugins API Documentation v5.0RC1

Public Member Functions | Public Attributes | Properties | Events | List of all members
Photon.Hive.Plugin.PropertyBag< TKey > Class Template Reference

The property bag. More...

Public Member Functions

 PropertyBag ()
 Initializes a new instance of the PropertyBag<TKey> class. More...
 
 PropertyBag (IEnumerable< KeyValuePair< TKey, object >> values)
 Initializes a new instance of the PropertyBag<TKey> class. More...
 
 PropertyBag (IDictionary values)
 Initializes a new instance of the PropertyBag<TKey> class. More...
 
IDictionary< TKey, Property< TKey > > AsDictionary ()
 
IList< Property< TKey > > GetAll ()
 The get all. More...
 
Hashtable GetProperties ()
 Get all properties. More...
 
Hashtable GetProperties (IList< TKey > propertyKeys)
 The get properties. More...
 
Hashtable GetProperties (IEnumerable< TKey > propertyKeys)
 The get properties. More...
 
Hashtable GetProperties (IEnumerable propertyKeys)
 The get properties. More...
 
Property< TKey > GetProperty (TKey key)
 The get property. More...
 
bool SetProperty (TKey key, object value)
 
bool SetProperty (TKey key, object value, KeyValuePair< int, int >? keyValueSizes)
 tries to set property and returns whether it was changed More...
 
void Set (TKey key, object value)
 
void Set (TKey key, object value, KeyValuePair< int, int >? keyValueSizes)
 tries to set property More...
 
void SetProperties (IDictionary values)
 The set properties. More...
 
void SetProperties (IDictionary values, out bool changed)
 
void SetProperties (IDictionary values, out bool changed, Dictionary< object, KeyValuePair< int, int >> metaData)
 
bool SetPropertiesCAS (IDictionary values, IDictionary expectedValues, out string debugMessage)
 The set properties. More...
 
bool CompareProperties (IDictionary expectedValues, out string debugMessage)
 
bool SetPropertiesCAS (IDictionary values, IDictionary expectedValues, ref bool valuesChanged, out string debugMessage)
 
bool SetPropertiesCAS (IDictionary values, IDictionary expectedValues, ref bool valuesChanged, out string debugMessage, Dictionary< object, KeyValuePair< int, int >> metaData)
 The set properties. More...
 
void SetProperties (IDictionary< TKey, object > values)
 The set properties. More...
 
void SetProperties (IDictionary< TKey, object > values, out bool changed)
 
bool SetPropertiesCAS (IDictionary< TKey, object > values, IDictionary< TKey, object > expectedValues, out string debugMessage)
 The set properties. More...
 
bool TryGetValue (TKey key, out object value)
 
void Clear ()
 

Public Attributes

int Count => this.dictionary.Count
 Gets the number of properties in this instance. More...
 

Properties

bool DeleteNullProps [get, set]
 
int TotalSize [get]
 

Events

EventHandler< PropertyChangedEventArgs< TKey > > PropertyChanged
 The property changed event. More...
 

Detailed Description

The property bag.

Template Parameters
TKeyThe property key type

Constructor & Destructor Documentation

◆ PropertyBag() [1/3]

Initializes a new instance of the PropertyBag<TKey> class.

◆ PropertyBag() [2/3]

Photon.Hive.Plugin.PropertyBag< TKey >.PropertyBag ( IEnumerable< KeyValuePair< TKey, object >>  values)
inline

Initializes a new instance of the PropertyBag<TKey> class.

Parameters
valuesThe values.

◆ PropertyBag() [3/3]

Photon.Hive.Plugin.PropertyBag< TKey >.PropertyBag ( IDictionary  values)
inline

Initializes a new instance of the PropertyBag<TKey> class.

Parameters
valuesThe values.

Member Function Documentation

◆ AsDictionary()

IDictionary<TKey, Property<TKey> > Photon.Hive.Plugin.PropertyBag< TKey >.AsDictionary ( )
inline

◆ Clear()

void Photon.Hive.Plugin.PropertyBag< TKey >.Clear ( )
inline

◆ CompareProperties()

bool Photon.Hive.Plugin.PropertyBag< TKey >.CompareProperties ( IDictionary  expectedValues,
out string  debugMessage 
)
inline

◆ GetAll()

IList<Property<TKey> > Photon.Hive.Plugin.PropertyBag< TKey >.GetAll ( )
inline

The get all.

Returns
A list of all properties

◆ GetProperties() [1/4]

Hashtable Photon.Hive.Plugin.PropertyBag< TKey >.GetProperties ( )
inline

Get all properties.

Returns
A copy of all properties with keys

◆ GetProperties() [2/4]

Hashtable Photon.Hive.Plugin.PropertyBag< TKey >.GetProperties ( IEnumerable  propertyKeys)
inline

The get properties.

Parameters
propertyKeysThe property keys.
Returns
The values for the given propertyKeys

◆ GetProperties() [3/4]

Hashtable Photon.Hive.Plugin.PropertyBag< TKey >.GetProperties ( IEnumerable< TKey >  propertyKeys)
inline

The get properties.

Parameters
propertyKeysThe property keys.
Returns
The values for the given propertyKeys

◆ GetProperties() [4/4]

Hashtable Photon.Hive.Plugin.PropertyBag< TKey >.GetProperties ( IList< TKey >  propertyKeys)
inline

The get properties.

Parameters
propertyKeysThe property keys.
Returns
The values for the given propertyKeys

◆ GetProperty()

Property<TKey> Photon.Hive.Plugin.PropertyBag< TKey >.GetProperty ( TKey  key)
inline

The get property.

Parameters
keyThe key.
Returns
The value for the key .

◆ Set() [1/2]

void Photon.Hive.Plugin.PropertyBag< TKey >.Set ( TKey  key,
object  value 
)
inline

◆ Set() [2/2]

void Photon.Hive.Plugin.PropertyBag< TKey >.Set ( TKey  key,
object  value,
KeyValuePair< int, int >?  keyValueSizes 
)
inline

tries to set property

Parameters
key
value
keyValueSizes

◆ SetProperties() [1/5]

void Photon.Hive.Plugin.PropertyBag< TKey >.SetProperties ( IDictionary  values)
inline

The set properties.

Parameters
valuesThe values.

◆ SetProperties() [2/5]

void Photon.Hive.Plugin.PropertyBag< TKey >.SetProperties ( IDictionary  values,
out bool  changed 
)
inline

◆ SetProperties() [3/5]

void Photon.Hive.Plugin.PropertyBag< TKey >.SetProperties ( IDictionary  values,
out bool  changed,
Dictionary< object, KeyValuePair< int, int >>  metaData 
)
inline

◆ SetProperties() [4/5]

void Photon.Hive.Plugin.PropertyBag< TKey >.SetProperties ( IDictionary< TKey, object >  values)
inline

The set properties.

Parameters
valuesThe values.

◆ SetProperties() [5/5]

void Photon.Hive.Plugin.PropertyBag< TKey >.SetProperties ( IDictionary< TKey, object >  values,
out bool  changed 
)
inline

◆ SetPropertiesCAS() [1/4]

bool Photon.Hive.Plugin.PropertyBag< TKey >.SetPropertiesCAS ( IDictionary  values,
IDictionary  expectedValues,
out string  debugMessage 
)
inline

The set properties.

Parameters
valuesThe values.
expectedValuesThe expected values for properties in order to apply CAS.
debugMessage

◆ SetPropertiesCAS() [2/4]

bool Photon.Hive.Plugin.PropertyBag< TKey >.SetPropertiesCAS ( IDictionary  values,
IDictionary  expectedValues,
ref bool  valuesChanged,
out string  debugMessage 
)
inline

◆ SetPropertiesCAS() [3/4]

bool Photon.Hive.Plugin.PropertyBag< TKey >.SetPropertiesCAS ( IDictionary  values,
IDictionary  expectedValues,
ref bool  valuesChanged,
out string  debugMessage,
Dictionary< object, KeyValuePair< int, int >>  metaData 
)
inline

The set properties.

Parameters
valuesThe values.
expectedValuesThe expected values for properties in order to apply CAS.
valuesChangedinforms whether values were really changed
debugMessage
metaData

◆ SetPropertiesCAS() [4/4]

bool Photon.Hive.Plugin.PropertyBag< TKey >.SetPropertiesCAS ( IDictionary< TKey, object >  values,
IDictionary< TKey, object >  expectedValues,
out string  debugMessage 
)
inline

The set properties.

Parameters
valuesThe values.
expectedValuesexpected values for properties, which we are going to change
debugMessage

◆ SetProperty() [1/2]

bool Photon.Hive.Plugin.PropertyBag< TKey >.SetProperty ( TKey  key,
object  value 
)
inline

◆ SetProperty() [2/2]

bool Photon.Hive.Plugin.PropertyBag< TKey >.SetProperty ( TKey  key,
object  value,
KeyValuePair< int, int >?  keyValueSizes 
)
inline

tries to set property and returns whether it was changed

Parameters
keyThe key.
valueThe value.
keyValueSizes

◆ TryGetValue()

bool Photon.Hive.Plugin.PropertyBag< TKey >.TryGetValue ( TKey  key,
out object  value 
)
inline

Member Data Documentation

◆ Count

int Photon.Hive.Plugin.PropertyBag< TKey >.Count => this.dictionary.Count

Gets the number of properties in this instance.

Property Documentation

◆ DeleteNullProps

bool Photon.Hive.Plugin.PropertyBag< TKey >.DeleteNullProps
getset

◆ TotalSize

int Photon.Hive.Plugin.PropertyBag< TKey >.TotalSize
get

Event Documentation

◆ PropertyChanged

EventHandler<PropertyChangedEventArgs<TKey> > Photon.Hive.Plugin.PropertyBag< TKey >.PropertyChanged

The property changed event.