RouteValueExpressionEditor.EvaluateExpression(String, Object, Type, IServiceProvider) 方法

定义

计算 RouteValue 表达式并提供设计时值。Evaluates a RouteValue expression and provides the design-time value.

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

参数

expression
String

要计算的 RouteValue 表达式。A RouteValue expression to evaluate. 该表达式不包含 RouteValue 表达式前缀。The expression does not include the RouteValue expression prefix.

parseTimeData
Object

一个对象,其中包含用于计算表达式的其他分析信息。An object that contains additional parsing information that is used to evaluate the expression.

propertyType
Type

控件属性的类型。The type of the control property.

serviceProvider
IServiceProvider

一个服务提供程序实现,它由设计器宿主提供,用于获取其他设计时服务。A service provider implementation that is supplied by the designer host and that is used to obtain additional design-time services.

返回

如果表达式计算成功,则为指定 URL 参数的值;否则为 nullThe value of the specified URL parameter if the expression evaluation succeeded; otherwise, null.

注解

可视化设计器使用 EvaluateExpression 方法来计算 RouteValue 表达式,并为关联的控件属性提供设计时值。The visual designer uses the EvaluateExpression method to evaluate a RouteValue expression and to provide the design-time value for an associated control property.

适用于

另请参阅