Table of Contents

Class CachedModelMetadata<TPrototypeCache>

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Provides a container for cached metadata.

public abstract class CachedModelMetadata<TPrototypeCache> : ModelMetadata

Type Parameters

TPrototypeCache

he type of the container.

Inheritance
CachedModelMetadata<TPrototypeCache>
Derived
Inherited Members

Constructors

CachedModelMetadata(CachedDataAnnotationsModelMetadataProvider, Type, Type, string, TPrototypeCache)

Constructor for creating real instances of the metadata class based on a prototype.

protected CachedModelMetadata(CachedDataAnnotationsModelMetadataProvider provider, Type containerType, Type modelType, string propertyName, TPrototypeCache prototypeCache)

Parameters

provider CachedDataAnnotationsModelMetadataProvider

The provider.

containerType Type

The container type.

modelType Type

The model type.

propertyName string

The property name.

prototypeCache TPrototypeCache

The prototype.

CachedModelMetadata(CachedModelMetadata<TPrototypeCache>, Func<object>)

Constructor for creating the prototype instances of the metadata class.

protected CachedModelMetadata(CachedModelMetadata<TPrototypeCache> prototype, Func<object> modelAccessor)

Parameters

prototype CachedModelMetadata<TPrototypeCache>

The prototype.

modelAccessor Func<object>

The model accessor.

Properties

ConvertEmptyStringToNull

Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null.

public override sealed bool ConvertEmptyStringToNull { get; set; }

Property Value

bool

A cached value that indicates whether empty strings that are posted back in forms should be converted to null.

DataTypeName

Gets or sets meta information about the data type.

public override sealed string DataTypeName { get; set; }

Property Value

string

The meta information about the data type.

Description

Gets or sets the description of the model.

public override sealed string Description { get; set; }

Property Value

string

The description of the model.

DisplayFormatString

Gets or sets the display format string for the model.

public override sealed string DisplayFormatString { get; set; }

Property Value

string

The display format string for the model.

DisplayName

Gets or sets the display name of the model.

public override sealed string DisplayName { get; set; }

Property Value

string

The display name of the model.

EditFormatString

Gets or sets the edit format string of the model.

public override sealed string EditFormatString { get; set; }

Property Value

string

The edit format string of the model.

HideSurroundingHtml

Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements.

public override sealed bool HideSurroundingHtml { get; set; }

Property Value

bool

A value that indicates whether the model object should be rendered using associated HTML elements.

HtmlEncode

public override sealed bool HtmlEncode { get; set; }

Property Value

bool

IsReadOnly

Gets or sets a value that indicates whether the model is read-only.

public override sealed bool IsReadOnly { get; set; }

Property Value

bool

A value that indicates whether the model is read-only.

IsRequired

Gets or sets a value that indicates whether the model is required.

public override sealed bool IsRequired { get; set; }

Property Value

bool

A value that indicates whether the model is required.

NullDisplayText

Gets or sets the string to display for null values.

public override sealed string NullDisplayText { get; set; }

Property Value

string

The string to display for null values.

Order

Gets or sets a value that represents order of the current metadata.

public override sealed int Order { get; set; }

Property Value

int

The order value of the current metadata.

PrototypeCache

Gets or sets the prototype cache.

protected TPrototypeCache PrototypeCache { get; set; }

Property Value

TPrototypeCache

The prototype cache.

ShortDisplayName

Gets or sets a short display name.

public override sealed string ShortDisplayName { get; set; }

Property Value

string

The short display name.

ShowForDisplay

Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views.

public override sealed bool ShowForDisplay { get; set; }

Property Value

bool

true if the model should be displayed in read-only views; otherwise, false.

ShowForEdit

Gets or sets a value that indicates whether the model should be displayed in editable views.

public override sealed bool ShowForEdit { get; set; }

Property Value

bool

true if the model should be displayed in editable views; otherwise, false.

SimpleDisplayText

Gets or sets the simple display string for the model.

public override sealed string SimpleDisplayText { get; set; }

Property Value

string

The simple display string for the model.

TemplateHint

Gets or sets a hint that suggests what template to use for this model.

public override sealed string TemplateHint { get; set; }

Property Value

string

A hint that suggests what template to use for this model.

Watermark

Gets or sets a value that can be used as a watermark.

public override sealed string Watermark { get; set; }

Property Value

string

A value that can be used as a watermark.

Methods

ComputeConvertEmptyStringToNull()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that indicates whether empty strings that are posted back in forms should be converted to null.

protected virtual bool ComputeConvertEmptyStringToNull()

Returns

bool

A cached value that indicates whether empty strings that are posted back in forms should be converted to null.

ComputeDataTypeName()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets meta information about the data type.

protected virtual string ComputeDataTypeName()

Returns

string

Meta information about the data type.

ComputeDescription()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets the description of the model.

protected virtual string ComputeDescription()

Returns

string

The description of the model.

ComputeDisplayFormatString()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets the display format string for the model.

protected virtual string ComputeDisplayFormatString()

Returns

string

The display format string for the model.

ComputeDisplayName()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets the display name of the model.

protected virtual string ComputeDisplayName()

Returns

string

The display name of the model.

ComputeEditFormatString()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets the edit format string of the model.

protected virtual string ComputeEditFormatString()

Returns

string

The edit format string of the model.

ComputeHasNonDefaultEditFormat()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.

protected virtual bool ComputeHasNonDefaultEditFormat()

Returns

bool

A value that indicates whether a non-default edit format is used.

ComputeHideSurroundingHtml()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that indicates whether the model object should be rendered using associated HTML elements.

protected virtual bool ComputeHideSurroundingHtml()

Returns

bool

A cached value that indicates whether the model object should be rendered using associated HTML elements.

ComputeHtmlEncode()

protected virtual bool ComputeHtmlEncode()

Returns

bool

ComputeIsReadOnly()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that indicates whether the model is read-only.

protected virtual bool ComputeIsReadOnly()

Returns

bool

A cached value that indicates whether the model is read-only.

ComputeIsRequired()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that indicates whether the model is required.

protected virtual bool ComputeIsRequired()

Returns

bool

A cached value that indicates whether the model is required.

ComputeNullDisplayText()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets the cached string to display for null values.

protected virtual string ComputeNullDisplayText()

Returns

string

The cached string to display for null values.

ComputeOrder()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that represents order of the current metadata.

protected virtual int ComputeOrder()

Returns

int

A cached value that represents order of the current metadata.

ComputeShortDisplayName()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a short display name.

protected virtual string ComputeShortDisplayName()

Returns

string

A short display name.

ComputeShowForDisplay()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that indicates whether the property should be displayed in read-only views such as list and detail views.

protected virtual bool ComputeShowForDisplay()

Returns

bool

A cached value that indicates whether the property should be displayed in read-only views such as list and detail views.

ComputeShowForEdit()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that indicates whether the model should be displayed in editable views.

protected virtual bool ComputeShowForEdit()

Returns

bool

A cached value that indicates whether the model should be displayed in editable views.

ComputeSimpleDisplayText()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets the cached simple display string for the model.

protected virtual string ComputeSimpleDisplayText()

Returns

string

The cached simple display string for the model.

ComputeTemplateHint()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached hint that suggests what template to use for this model.

protected virtual string ComputeTemplateHint()

Returns

string

A cached hint that suggests what template to use for this model.

ComputeWatermark()

This method is protected and therefore cannot be called directly. This method was designed to be overridden in a deriving class such as CachedDataAnnotationsModelMetadata.Gets or sets a cached value that can be used as a watermark.

protected virtual string ComputeWatermark()

Returns

string

A cached value that can be used as a watermark.

GetSimpleDisplayText()

Gets or sets the simple display string for the model.

protected override sealed string GetSimpleDisplayText()

Returns

string

The simple display string for the model.