Class SerializableDictionaryBase<TKey, TValue, TValueStorage>
[Serializable]
public abstract class SerializableDictionaryBase<TKey, TValue, TValueStorage> : SerializableDictionaryBase, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, ISerializationCallbackReceiver, IDeserializationCallback, ISerializable
Type Parameters
TKeyTValueTValueStorage
- Inheritance
-
SerializableDictionaryBase<TKey, TValue, TValueStorage>
- Implements
-
IDictionary<TKey, TValue>ICollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>ISerializationCallbackReceiver
- Derived
- Inherited Members
Constructors
SerializableDictionaryBase()
SerializableDictionaryBase method.
public SerializableDictionaryBase()
SerializableDictionaryBase(IDictionary<TKey, TValue>)
SerializableDictionaryBase method.
public SerializableDictionaryBase(IDictionary<TKey, TValue> dict)
Parameters
dictIDictionary<TKey, TValue>The dict parameter.
SerializableDictionaryBase(SerializationInfo, StreamingContext)
SerializableDictionaryBase method.
protected SerializableDictionaryBase(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe info parameter.
contextStreamingContextThe context parameter.
Properties
Count
Gets or sets the Count value.
public int Count { get; }
Property Value
IsFixedSize
Gets a value indicating whether the fixedsize condition is met.
public bool IsFixedSize { get; }
Property Value
IsReadOnly
Gets a value indicating whether the readonly condition is met.
public bool IsReadOnly { get; }
Property Value
IsSynchronized
Gets a value indicating whether the synchronized condition is met.
public bool IsSynchronized { get; }
Property Value
this[object]
Gets or sets the value associated with the specified key.
public object this[object key] { get; set; }
Parameters
keyobjectThe key of the value to get or set.
Property Value
- object
The value associated with the specified key.
this[TKey]
Gets or sets the value associated with the specified key.
public TValue this[TKey key] { get; set; }
Parameters
keyTKeyThe key of the value to get or set.
Property Value
- TValue
The value associated with the specified key.
Keys
Gets the collection of keys.
public ICollection<TKey> Keys { get; }
Property Value
- ICollection<TKey>
SyncRoot
Gets or sets the SyncRoot value.
public object SyncRoot { get; }
Property Value
Values
Gets the collection of values.
public ICollection<TValue> Values { get; }
Property Value
- ICollection<TValue>
Methods
Add(KeyValuePair<TKey, TValue>)
Adds an item to the collection.
public void Add(KeyValuePair<TKey, TValue> item)
Parameters
itemKeyValuePair<TKey, TValue>The item parameter.
Add(object, object)
Adds an item to the collection.
public void Add(object key, object value)
Parameters
Add(TKey, TValue)
Adds an item to the collection.
public void Add(TKey key, TValue value)
Parameters
keyTKeyThe key parameter.
valueTValueThe value parameter.
Clear()
Clears all items from the collection.
public void Clear()
Contains(KeyValuePair<TKey, TValue>)
Checks whether the ntains condition is met.
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
itemKeyValuePair<TKey, TValue>The item parameter.
Returns
- bool
True if the condition is met; otherwise, false.
Contains(object)
Checks whether the ntains condition is met.
public bool Contains(object key)
Parameters
keyobjectThe key parameter.
Returns
- bool
True if the condition is met; otherwise, false.
ContainsKey(TKey)
Checks whether the ntainskey condition is met.
public bool ContainsKey(TKey key)
Parameters
keyTKeyThe key parameter.
Returns
- bool
True if the condition is met; otherwise, false.
CopyFrom(IDictionary<TKey, TValue>)
Copies data from another collection into this one.
public void CopyFrom(IDictionary<TKey, TValue> dict)
Parameters
dictIDictionary<TKey, TValue>The dict parameter.
CopyTo(Array, int)
Copies the collection elements to an array.
public void CopyTo(Array array, int index)
Parameters
CopyTo(KeyValuePair<TKey, TValue>[], int)
Copies the collection elements to an array.
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
arrayKeyValuePair<TKey, TValue>[]The array parameter.
arrayIndexintThe arrayIndex parameter.
GetEnumerator()
Gets the enumerator value.
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<TKey, TValue>>
An enumerator for iterating through the collection.
GetObjectData(SerializationInfo, StreamingContext)
Gets the objectdata value.
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
infoSerializationInfoThe info parameter.
contextStreamingContextThe context parameter.
GetValue(TValueStorage[], int)
Gets the value value.
protected abstract TValue GetValue(TValueStorage[] storage, int i)
Parameters
storageTValueStorage[]The storage parameter.
iintThe i parameter.
Returns
- TValue
An integer result.
OnAfterDeserialize()
Called after deserialization to reconstruct internal state.
public void OnAfterDeserialize()
OnBeforeSerialize()
Called before serialization to prepare data for storage.
public void OnBeforeSerialize()
OnDeserialization(object)
Called when deserialization is complete.
public void OnDeserialization(object sender)
Parameters
senderobjectThe sender parameter.
Remove(KeyValuePair<TKey, TValue>)
Removes an item from the collection.
public bool Remove(KeyValuePair<TKey, TValue> item)
Parameters
itemKeyValuePair<TKey, TValue>The item parameter.
Returns
- bool
True if successful; otherwise, false.
Remove(object)
Removes an item from the collection.
public void Remove(object key)
Parameters
keyobjectThe key parameter.
Remove(TKey)
Removes an item from the collection.
public bool Remove(TKey key)
Parameters
keyTKeyThe key parameter.
Returns
- bool
True if successful; otherwise, false.
SetValue(TValueStorage[], int, TValue)
Sets the value value.
protected abstract void SetValue(TValueStorage[] storage, int i, TValue value)
Parameters
storageTValueStorage[]The storage parameter.
iintThe i parameter.
valueTValueThe value parameter.
TryGetValue(TKey, out TValue)
Attempts to perform the getvalue operation.
public bool TryGetValue(TKey key, out TValue value)
Parameters
keyTKeyThe key parameter.
valueTValue
Returns
- bool
True if successful, false otherwise.