Class ProviderDictionary<TKey, TValue>
- Namespace
- CMS.DataEngine
- Assembly
- CMS.DataEngine.dll
Provider dictionary.
public class ProviderDictionary<TKey, TValue> : IProviderDictionary<TKey, TValue>, IProviderDictionary
Type Parameters
TKey
TValue
- Inheritance
-
objectProviderDictionary<TKey, TValue>
- Implements
-
IProviderDictionary<TKey, TValue>
- Derived
- Extension Methods
Constructors
ProviderDictionary(string, string, IEqualityComparer<TKey>, bool, bool)
Creates new instance of ProviderDictionary<TKey, TValue>.
public ProviderDictionary(string objectType, string columnNames, IEqualityComparer<TKey> comparer = null, bool allowNulls = false, bool useWeakReferences = false)
Parameters
objectType
stringObject type
columnNames
stringColumn names included in the object key (list of columns separated by semicolon)
comparer
IEqualityComparer<TKey>Equality comparer for the items
allowNulls
boolIndicates whether null value will be considered as valid and will be cached.
useWeakReferences
boolIndicates whether cache item can be removed from cache in case of insufficient memory.
Properties
ColumnNames
Column names
public string ColumnNames { get; protected set; }
Property Value
- string
Count
Items count (all keys).
public long Count { get; }
Property Value
- long
DataIsValid
Returns true if the dictionary content is valid.
public bool DataIsValid { get; }
Property Value
- bool
Enabled
If true, the dictionary is enabled.
public bool Enabled { get; set; }
Property Value
- bool
IsEmpty
Returns true if the Dictionary is empty.
public bool IsEmpty { get; }
Property Value
- bool
this[TKey]
Dictionary indexer.
public virtual TValue this[TKey key] { get; set; }
Parameters
key
TKeyObject key
Property Value
- TValue
LogWebFarmTasks
Gets / sets if the dictionary should log web farm tasks
public bool LogWebFarmTasks { get; set; }
Property Value
- bool
Name
Dictionary name.
public string Name { get; protected set; }
Property Value
- string
ObjectType
Object type
public string ObjectType { get; protected set; }
Property Value
- string
Methods
Add(TKey, TValue)
Adds the specified object.
public void Add(TKey key, TValue value)
Parameters
key
TKeyKey to add
value
TValueValue
Add(TKey, TValue, bool)
Adds the specified object.
public virtual void Add(TKey key, TValue value, bool logTask)
Parameters
key
TKeyKey to add
value
TValueValue
logTask
boolIf true, web farm task is logged
Clear(bool)
Clears all the items.
public void Clear(bool logTask)
Parameters
logTask
boolIf true, web farm task is logged
ContainsKey(TKey)
Returns true if the table contains specified record.
public bool ContainsKey(TKey key)
Parameters
key
TKeyKey to check
Returns
- bool
ConvertKey(object)
Converts the key to a specific type
protected virtual TKey ConvertKey(object key)
Parameters
key
objectKey to convert
Returns
- TKey
Delete(TKey)
Removes the specified object and logs the web farm task.
public void Delete(TKey key)
Parameters
key
TKeyKey to remove
Invalidate(bool)
Invalidates the dictionary content.
public virtual void Invalidate(bool logTask)
Parameters
logTask
boolIf true, web farm task is logged
LogWebFarmTask(string, string)
Logs the web farm task with specified task data.
public virtual void LogWebFarmTask(string taskTextData, string taskOperation)
Parameters
taskTextData
stringTask text data
taskOperation
stringOperation to realize with object
LogWebFarmTask(TKey, string)
Logs the web farm task for specified object key.
public void LogWebFarmTask(TKey key, string taskOperation)
Parameters
key
TKeyObject key
taskOperation
stringOperation to realize with object
Remove(TKey)
Removes the specified object.
public void Remove(TKey key)
Parameters
key
TKeyKey to remove
Remove(TKey, bool)
Removes the specified object.
public virtual void Remove(TKey key, bool logTask)
Parameters
key
TKeyKey to remove
logTask
boolIf true, web farm task is logged
RemoveInternal(TKey)
Removes the key from the internal dictionary
protected virtual void RemoveInternal(TKey key)
Parameters
key
TKeyKey to remove
TryGetInternal(TKey, out TValue)
Returns true if the internal dictionary contains specified record.
protected virtual bool TryGetInternal(TKey key, out TValue value)
Parameters
key
TKeyKey to check
value
TValueReturns the object value if the object is present
Returns
- bool
TryGetValue(TKey, out TValue)
Gets the value associated with the specified key.
public bool TryGetValue(TKey key, out TValue value)
Parameters
key
TKeyKey to check
value
TValueReturns the object value if the object is present
Returns
- bool
Update(TKey, TValue)
Updates the specified object and logs the web farm task.
public virtual void Update(TKey key, TValue value)
Parameters
key
TKeyKey to add
value
TValueValue