DialogStateManager.GetValue<T>(String, Func<T>) 方法

定义

使用路径表达式从内存中获取值 (注意:这始终返回值) 的克隆。

public T GetValue<T>(string pathExpression, Func<T> defaultValue = default);
member this.GetValue : string * Func<'T> -> 'T
Public Function GetValue(Of T) (pathExpression As String, Optional defaultValue As Func(Of T) = Nothing) As T

类型参数

T

要返回的值类型。

参数

pathExpression
String

要使用的路径表达式。

defaultValue
Func<T>

函数,用于在没有任何可选) 时提供默认值 (。

返回

T

如果路径无效,则返回结果或 null。

注解

这始终返回内存的 CLONE,对此结果的任何修改都不会影响内存。

适用于