DynamicDictionaryTVal Class

基于 DynamicObject 实现的动态字典类,其键的类型为字符串,且键值不区分大小写。 此类同时具备 DynamicObject 类以及字典类的功能。

Definition

Namespace: QuickAdmin.Utils
Assembly: QuickAdmin.Net (in QuickAdmin.Net.dll) Version: 1.1.6
C#
public class DynamicDictionary<TVal> : DynamicObject, 
	IDictionary<string, TVal>, ICollection<KeyValuePair<string, TVal>>, 
	IEnumerable<KeyValuePair<string, TVal>>, IEnumerable
Inheritance
object    DynamicObject    DynamicDictionaryTVal
Derived
Implements
ICollectionKeyValuePairstring, TVal, IDictionarystring, TVal, IEnumerableKeyValuePairstring, TVal, IEnumerable

Type Parameters

TVal
字典中的值的类型。

Constructors

DynamicDictionaryTVal 构造新实例。
DynamicDictionaryTVal(IDictionarystring, TVal) 用现有字典构造新实例。

Properties

Public Properties

CountGets the number of elements contained in the ICollectionT.
IsReadOnly 指示本集合是否为只读。
ItemGets or sets the element with the specified key.
KeysGets an ICollectionT containing the keys of the IDictionaryTKey, TValue.
ValuesGets an ICollectionT containing the values in the IDictionaryTKey, TValue.

Methods

Public Methods

Add(KeyValuePairstring, TVal) 添加指定键值对中的内容。
Add(string, TVal)Adds an element with the provided key and value to the IDictionaryTKey, TValue.
ClearRemoves all items from the ICollectionT.
Contains 确定是否包含带有 指定键值对中的内容 的元素。
ContainsKeyDetermines whether the IDictionaryTKey, TValue contains an element with the specified key.
ContainsValue 确定是否包含带有指定值的元素。
CopyToCopies the elements of the ICollectionT to an Array, starting at a particular Array index.
CreateDynamicListFrom(IListDictionarystring, TVal) 使用现有字典类列表,创建动态字典类列表。
CreateDynamicListFrom(IListIDictionarystring, TVal) 使用现有字典接口列表,创建动态字典类列表。
CreateDynamicListFrom(Listobject) 使用现有动态对象列表,创建动态字典类列表。
GetEnumeratorReturns an enumerator that iterates through the collection.
Remove(KeyValuePairstring, TVal) 移除带有 指定键值对中的内容 的元素。
Remove(string)Removes the element with the specified key from the IDictionaryTKey, TValue.
TryGetMemberProvides the implementation for operations that get member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as getting a value for a property.
(Overrides DynamicObjectTryGetMember(GetMemberBinder, object))
TryGetValueGets the value associated with the specified key.
TrySetMemberProvides the implementation for operations that set member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as setting a value for a property.
(Overrides DynamicObjectTrySetMember(SetMemberBinder, object))

Fields

Protected Fields

dictionary 本类内部用来存储数据的字典实例,其键值全部被以小写形式存储。

Explicit Interface Implementations

IEnumerableGetEnumeratorReturns an enumerator that iterates through a collection.

See Also