LambdaValue<TResult>.CanConvertToString(IValueSerializerContext) 方法

定义

此方法始终返回 true,并与 ConvertToString(IValueSerializerContext) 结合使用以便在尝试将此活动序列化为 XAML 时提供描述性错误消息。This method always returns true and is used in conjunction with ConvertToString(IValueSerializerContext) to provide descriptive error messages when an attempt is made to serialize this activity to XAML.

public:
 virtual bool CanConvertToString(System::Windows::Markup::IValueSerializerContext ^ context);
public bool CanConvertToString (System.Windows.Markup.IValueSerializerContext context);
abstract member CanConvertToString : System.Windows.Markup.IValueSerializerContext -> bool
override this.CanConvertToString : System.Windows.Markup.IValueSerializerContext -> bool
Public Function CanConvertToString (context As IValueSerializerContext) As Boolean

参数

context
IValueSerializerContext

用于转换的上下文信息。Context information that is used for conversion.

返回

Boolean

此方法始终返回 trueThis method always returns true.

实现

注解

LambdaValue<TResult> 用于代码中指定的 lambda 表达式,并且不能序列化为 XAML。LambdaValue<TResult> is used for lambda expressions specified in code and cannot be serialized to XAML. 如果尝试序列化包含 LambdaValue<TResult> 的工作流,则会引发 LambdaSerializationExceptionIf an attempt to serialize a workflow that contains a LambdaValue<TResult> is made, a LambdaSerializationException is thrown. 如果包含工作流需要 XAML 序列化,请使用 VisualBasicValue<TResult> 或使用 ExpressionServicesLambdaValue<TResult> 转换为可序列化的格式。If the containing workflow requires XAML serialization, use VisualBasicValue<TResult> or use ExpressionServices to convert the LambdaValue<TResult> to a format that can be serialized.

适用于