แก้ไข

แชร์ผ่าน


ResourceExpressionEditor.EvaluateExpression Method

Definition

Evaluates a resource expression and provides the design-time value for a control property.

public:
 override System::Object ^ EvaluateExpression(System::String ^ expression, System::Object ^ parseTimeData, Type ^ propertyType, IServiceProvider ^ serviceProvider);
public override object EvaluateExpression (string expression, object parseTimeData, Type propertyType, IServiceProvider serviceProvider);
override this.EvaluateExpression : string * obj * Type * IServiceProvider -> obj
Public Overrides Function EvaluateExpression (expression As String, parseTimeData As Object, propertyType As Type, serviceProvider As IServiceProvider) As Object

Parameters

expression
String

A resource expression to evaluate. expression does not include the Resources expression prefix.

parseTimeData
Object

An object supplying additional parse data, in the form of a ResourceExpressionFields value.

propertyType
Type

The type of the control property.

serviceProvider
IServiceProvider

A service provider implementation supplied by the designer host, used to obtain additional design-time services.

Returns

The object referenced by the evaluated expression string, if the expression evaluation succeeded; otherwise, null.

Remarks

The EvaluateExpression method looks up the resource that is specified by expression, and then returns the resource.

The visual designer uses the EvaluateExpression method to evaluate a resource expression and provide the design-time value for an associated control property. At run time, the page parser uses the EvaluateExpression and GetCodeExpression methods of the corresponding ResourceExpressionBuilder implementation to evaluate an expression and provide the run-time value for an associated control property.

The visual designer uses the ParseExpression method to parse the expression string at design time, and then calls the EvaluateExpression method with the parsed expression data.

Applies to

See also