Click or drag to resize

ImmutableDictionary<TKey, TValue> Class

A dictionary that can be modified until IsReadOnly is set to true. Once this occurs, the dictionary itself can no longer be modified. Remember, this does not cause objects contained in this class to be Immutable unless they implement IImmutableObject.
Inheritance Hierarchy
System.Object
  GSF.Immutable.ImmutableObjectBase<ImmutableDictionary<TKey, TValue> >
    GSF.Immutable.ImmutableDictionary<TKey, TValue>

Namespace: GSF.Immutable
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.241-beta+912389e96d98840d2a999d490420db618dcbe4c6
Syntax
public sealed class ImmutableDictionary<TKey, TValue> : ImmutableObjectBase<ImmutableDictionary<TKey, TValue>>, 
	IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, 
	IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
View Source

Type Parameters

TKey
TValue

The ImmutableDictionary<TKey, TValue> type exposes the following members.

Constructors
 NameDescription
Public methodImmutableDictionary<TKey, TValue>() Creates a new ImmutableDictionary<TKey, TValue>.
Public methodImmutableDictionary<TKey, TValue>(Dictionary<TKey, TValue>) Creates a new ImmutableDictionary<TKey, TValue>.
Public methodImmutableDictionary<TKey, TValue>(Int32) Creates a new ImmutableDictionary<TKey, TValue>.
Top
Properties
 NameDescription
Public propertyCountGets the number of elements contained in the ICollection<T>.
Public propertyIsReadOnly Gets/Sets if this class is immutable and thus read only. Once setting to readonly, the class becomes immutable.
(Inherited from ImmutableObjectBase<T>)
Public propertyItemGets or sets the element with the specified key.
Public propertyKeysGets an ICollection<T> containing the keys of the IDictionary<TKey, TValue>.
Public propertyValuesGets an ICollection<T> containing the values in the IDictionary<TKey, TValue>.
Top
Methods
 NameDescription
Public methodAddAdds an element with the provided key and value to the IDictionary<TKey, TValue>.
Public methodClearRemoves all items from the ICollection<T>.
Public methodClone Returns a clone of this class. If the class is marked as readonly, it returns the current instance.
(Inherited from ImmutableObjectBase<T>)
Public methodCloneEditable Creates a clone of this class that is editable. A clone is always created, even if this class is already editable.
(Inherited from ImmutableObjectBase<T>)
Public methodCloneReadonly Makes a readonly clone of the object. If the class is currently marked as readonly, the current instance is returned.
(Inherited from ImmutableObjectBase<T>)
Public methodContainsDetermines whether the ICollection<T> contains a specific value.
Public methodContainsKeyDetermines whether the IDictionary<TKey, TValue> contains an element with the specified key.
Public methodCopyToCopies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodRemove(TKey)Removes the element with the specified key from the IDictionary<TKey, TValue>.
Public methodRemove(KeyValuePair<TKey, TValue>)Removes the first occurrence of a specific object from the ICollection<T>.
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Public methodTryGetValueGets the value associated with the specified key.
Top
Extension Methods
 NameDescription
Public Extension MethodAllParallel<KeyValuePair<TKey, TValue>> Determines whether all elements of a sequence satisfy a condition with each item being tested in parallel.
(Defined by CollectionExtensions)
Public Extension MethodDistinctBy<KeyValuePair<TKey, TValue>, TKey> Returns only the elements whose keys are distinct.
(Defined by CollectionExtensions)
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefault<T> Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodMajority<KeyValuePair<TKey, TValue>> Returns the majority value in the collection, or default type value if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMajority<KeyValuePair<TKey, TValue>> Returns the majority value in the collection, or defaultValue if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMajorityBy<KeyValuePair<TKey, TValue>, TKey> Returns the majority value in the collection, or default type value if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMajorityBy<KeyValuePair<TKey, TValue>, TKey> Returns the majority value in the collection, or defaultValue if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMax<KeyValuePair<TKey, TValue>>Returns the largest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMax<KeyValuePair<TKey, TValue>>Returns the largest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMaxBy<KeyValuePair<TKey, TValue>, TKey>Selects the largest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMedian<KeyValuePair<TKey, TValue>> Gets the median item(s) from an enumeration, i.e., one return item for odd lengths, two for even lengths.
(Defined by CollectionExtensions)
Public Extension MethodMiddle<KeyValuePair<TKey, TValue>> Gets the middle item(s) from an enumeration, i.e., one return item for odd lengths, two for even lengths.
(Defined by CollectionExtensions)
Public Extension MethodMin<KeyValuePair<TKey, TValue>>Returns the smallest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMin<KeyValuePair<TKey, TValue>>Returns the smallest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMinBy<KeyValuePair<TKey, TValue>, TKey>Selects the smallest item from the enumeration.
(Defined by CollectionExtensions)
Public Extension MethodMinority<KeyValuePair<TKey, TValue>> Returns the minority value in the collection, or default type value if no item represents the minority.
(Defined by CollectionExtensions)
Public Extension MethodMinority<KeyValuePair<TKey, TValue>> Returns the minority value in the collection, or defaultValue if no item represents the minority.
(Defined by CollectionExtensions)
Public Extension MethodMinorityBy<KeyValuePair<TKey, TValue>, TKey> Returns the minority value in the collection, or default type value if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodMinorityBy<KeyValuePair<TKey, TValue>, TKey> Returns the minority value in the collection, or defaultValue if no item represents the majority.
(Defined by CollectionExtensions)
Public Extension MethodStandardDeviation<KeyValuePair<TKey, TValue>> Computes the standard deviation over a sequence of Double values.
(Defined by NumericalAnalysisExtensions)
Public Extension MethodStandardDeviation<KeyValuePair<TKey, TValue>> Computes the standard deviation over a sequence of Decimal values.
(Defined by NumericalAnalysisExtensions)
Public Extension MethodStandardDeviation<KeyValuePair<TKey, TValue>> Computes the standard deviation over a sequence of Single values.
(Defined by NumericalAnalysisExtensions)
Public Extension MethodToDelimitedString<KeyValuePair<TKey, TValue>>Converts an enumeration to a string, using the default delimiter ("|") that can later be converted back to a list using LoadDelimitedString.
(Defined by CollectionExtensions)
Public Extension MethodToDelimitedString<KeyValuePair<TKey, TValue>>Converts an enumeration to a string that can later be converted back to a list using LoadDelimitedString.
(Defined by CollectionExtensions)
Public Extension MethodToDelimitedString<KeyValuePair<TKey, TValue>>Converts an enumeration to a string that can later be converted back to a list using LoadDelimitedString.
(Defined by CollectionExtensions)
Public Extension MethodToPagedList<KeyValuePair<TKey, TValue>> Gets a PagedList<T> to paginate source enumeration for a given page and specified pageSize.
(Defined by CollectionExtensions)
Top
See Also