Delen via


ViewDataDictionary Class

Definition

A IDictionary<TKey,TValue> for view data.

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))
Inheritance
ViewDataDictionary
Derived
Implements

Constructors

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type)

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary)

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(IModelMetadataProvider, Type)

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(ViewDataDictionary, Object, Type)

Initializes a new instance of the ViewDataDictionary class based in part on an existing instance. This constructor is careful to avoid exceptions SetModel(Object) may throw when model is null.

ViewDataDictionary(ViewDataDictionary, Type)

Initializes a new instance of the ViewDataDictionary class based in part on an existing instance.

ViewDataDictionary(ViewDataDictionary)

Initializes a new instance of the ViewDataDictionary class based entirely on an existing instance.

Properties

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

Gets or sets the current model.

ModelExplorer

Gets or sets the ModelExplorer for the Model.

ModelMetadata

Gets the ModelMetadata for an expression, the Model (if non-null), or the declared Type.

ModelState

Gets the ModelStateDictionary.

TemplateInfo

Gets the TemplateInfo.

Values

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

Methods

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, String)

Gets value of named expression in this ViewDataDictionary, formatted using given format.

Eval(String)

Gets value of named expression in this ViewDataDictionary.

FormatValue(Object, String)

Formats the given value using the given format.

GetViewDataInfo(String)

Gets ViewDataInfo for named expression in this 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)

Set ModelExplorer to ensure Model and Model reflect the new value.

TryGetValue(String, Object) System.Object.TryGetValue(System.String,System.Object@)

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

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

Returns an enumerator that iterates through the collection.

Applies to