Class SharedDictionary<TKey, TValue>
An
Inheritance
Implements
Namespace: DotNetNuke.Collections.Internal
Assembly: DotNetNuke.dll
Syntax
public class SharedDictionary<TKey, TValue> : IDictionary<TKey, TValue>
Type Parameters
| Name | Description |
|---|---|
| TKey | The type of the key. |
| TValue | The type of the value. |
Constructors
| Improve this Doc View SourceSharedDictionary()
Initializes a new instance of the SharedDictionary<TKey, TValue> class.
Declaration
public SharedDictionary()
SharedDictionary(ILockStrategy)
Initializes a new instance of the SharedDictionary<TKey, TValue> class.
Declaration
public SharedDictionary(ILockStrategy lockStrategy)
Parameters
| Type | Name | Description |
|---|---|---|
| ILockStrategy | lockStrategy | The locking strategy to use. |
SharedDictionary(LockingStrategy)
Initializes a new instance of the SharedDictionary<TKey, TValue> class.
Declaration
public SharedDictionary(LockingStrategy strategy)
Parameters
| Type | Name | Description |
|---|---|---|
| LockingStrategy | strategy | The locking strategy to use. |
Properties
| Improve this Doc View SourceCount
An
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
IsReadOnly
An
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Item[TKey]
An
Declaration
public TValue this[TKey key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key |
Property Value
| Type | Description |
|---|---|
| TValue |
Keys
An
Declaration
public ICollection<TKey> Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<TKey> |
Values
An
Declaration
public ICollection<TValue> Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<TValue> |
Methods
| Improve this Doc View SourceAdd(TKey, TValue)
An
Declaration
public void Add(TKey key, TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key | |
| TValue | value |
Add(KeyValuePair<TKey, TValue>)
An
Declaration
public void Add(KeyValuePair<TKey, TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<TKey, TValue> | item |
Clear()
An
Declaration
public void Clear()
Contains(KeyValuePair<TKey, TValue>)
An
Declaration
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<TKey, TValue> | item |
Returns
| Type | Description |
|---|---|
| System.Boolean |
ContainsKey(TKey)
An
Declaration
public bool ContainsKey(TKey key)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key |
Returns
| Type | Description |
|---|---|
| System.Boolean |
CopyTo(KeyValuePair<TKey, TValue>[], Int32)
An
Declaration
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<TKey, TValue>[] | array | |
| System.Int32 | arrayIndex |
Dispose()
An
Declaration
public void Dispose()
Dispose(Boolean)
Disposes this instance resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | A value indicating whether this instance is currently disposing. |
Finalize()
Finalizes an instance of the SharedDictionary<TKey, TValue> class.
Declaration
protected void Finalize()
GetEnumerator()
An
Declaration
public IEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator |
GetReadLock()
Gets a read lock.
Declaration
public ISharedCollectionLock GetReadLock()
Returns
| Type | Description |
|---|---|
| ISharedCollectionLock | An ISharedCollectionLock instance. |
GetReadLock(Int32)
Gets a read lock for a specified amount of time.
Declaration
public ISharedCollectionLock GetReadLock(int millisecondTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | millisecondTimeout | For how many milliseconds to lock for. |
Returns
| Type | Description |
|---|---|
| ISharedCollectionLock | An ISharedCollectionLock instance. |
GetReadLock(TimeSpan)
Gets a read lock for a specified amount of time.
Declaration
public ISharedCollectionLock GetReadLock(TimeSpan timeOut)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeOut | The amount of time to lock for. |
Returns
| Type | Description |
|---|---|
| ISharedCollectionLock | An ISharedCollectionLock instance. |
GetWriteLock()
Gets a write lock.
Declaration
public ISharedCollectionLock GetWriteLock()
Returns
| Type | Description |
|---|---|
| ISharedCollectionLock | An ISharedCollectionLock instance. |
GetWriteLock(Int32)
Gets a write lock for the specified amount of time.
Declaration
public ISharedCollectionLock GetWriteLock(int millisecondTimeout)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | millisecondTimeout | The amount of milliseconds to lock for. |
Returns
| Type | Description |
|---|---|
| ISharedCollectionLock | An ISharedCollectionLock instance. |
GetWriteLock(TimeSpan)
Gets a write lock for the specified amount of time.
Declaration
public ISharedCollectionLock GetWriteLock(TimeSpan timeOut)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeOut | The amount of time to lock for. |
Returns
| Type | Description |
|---|---|
| ISharedCollectionLock | An ISharedCollectionLock instance. |
IEnumerable_GetEnumerator()
Returns an enumerator to iterate through the collection.
Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> IEnumerable_GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<TKey, TValue>> | An enumerator that can be used to iterate through the collection. |
Remove(TKey)
An
Declaration
public bool Remove(TKey key)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key |
Returns
| Type | Description |
|---|---|
| System.Boolean |
Remove(KeyValuePair<TKey, TValue>)
An
Declaration
public bool Remove(KeyValuePair<TKey, TValue> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<TKey, TValue> | item |
Returns
| Type | Description |
|---|---|
| System.Boolean |
TryGetValue(TKey, out TValue)
An
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key | |
| TValue | value |
Returns
| Type | Description |
|---|---|
| System.Boolean |