ViewDataDictionary 类

定义

IDictionary<TKey,TValue>用于视图数据的。

public ref class ViewDataDictionary : System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>, System::Collections::Generic::IDictionary<System::String ^, System::Object ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
public class ViewDataDictionary : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IDictionary<string,object>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object>>
type ViewDataDictionary = class
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
type ViewDataDictionary = class
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
    interface IDictionary<string, obj>
Public Class ViewDataDictionary
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object))
继承
ViewDataDictionary
派生
实现

构造函数

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary)

初始化 ViewDataDictionary 类的新实例。

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type)

初始化 ViewDataDictionary 类的新实例。

ViewDataDictionary(IModelMetadataProvider, Type)

初始化 ViewDataDictionary 类的新实例。

ViewDataDictionary(ViewDataDictionary)

ViewDataDictionary完全基于现有实例初始化类的新实例。

ViewDataDictionary(ViewDataDictionary, Object, Type)

ViewDataDictionary基于现有实例的部分初始化类的新实例。 SetModel(Object)modelnull时,此构造函数将小心避免可能引发异常。

ViewDataDictionary(ViewDataDictionary, Type)

ViewDataDictionary基于现有实例的部分初始化类的新实例。

属性

Count

Gets the number of elements contained in the ICollection<T>.

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

Item[String]

Gets or sets the element with the specified key.

Keys

Gets an ICollection<T> containing the keys of the IDictionary<TKey,TValue>.

Model

获取或设置当前模型。

ModelExplorer

获取或设置 ModelExplorerModel

ModelMetadata

获取 ModelMetadata 表达式的, Model 如果) 为非null ,则为 (; 否则为 Type

ModelState

获取 ModelStateDictionary

TemplateInfo

获取 TemplateInfo

Values

Gets an ICollection<T> containing the values in the IDictionary<TKey,TValue>.

方法

Add(KeyValuePair<String,Object>)

Adds an item to the ICollection<T>.

Add(String, Object)

Adds an element with the provided key and value to the IDictionary<TKey,TValue>.

Clear()

Removes all items from the ICollection<T>.

Contains(KeyValuePair<String,Object>)

Determines whether the ICollection<T> contains a specific value.

ContainsKey(String)

Determines whether the IDictionary<TKey,TValue> contains an element with the specified key.

CopyTo(KeyValuePair<String,Object>[], Int32)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

Eval(String)

获取此中命名的的值 expression ViewDataDictionary

Eval(String, String)

获取 expression 在此中命名的值 ViewDataDictionary ,使用给定的格式化 format

FormatValue(Object, String)

使用给定的格式化给定的 value format

GetViewDataInfo(String)

获取 ViewDataInfo expression 此中命名的 ViewDataDictionary

Remove(KeyValuePair<String,Object>)

Removes the first occurrence of a specific object from the ICollection<T>.

Remove(String)

Removes the element with the specified key from the IDictionary<TKey,TValue>.

SetModel(Object)

设置 ModelExplorer 以确保 ModelModel 反映新的 value

TryGetValue(String, Object)

显式接口实现

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerable<KeyValuePair<String,Object>>.GetEnumerator()

Returns an enumerator that iterates through the collection.

适用于