Share via


ObjectPath.TryResolvePath(Object, String, List<Object>, Boolean) 方法

定义

给定根对象和属性路径,如果 eval = true,则解析为常量,否则解析为常量路径。
conversation[user.name][user.age] => ['conversation', 'joe', 32]。

public static bool TryResolvePath (object obj, string propertyPath, out System.Collections.Generic.List<object> segments, bool eval = false);
static member TryResolvePath : obj * string * List * bool -> bool
Public Shared Function TryResolvePath (obj As Object, propertyPath As String, ByRef segments As List(Of Object), Optional eval As Boolean = false) As Boolean

参数

obj
Object

根对象。

propertyPath
String

要解析的属性路径。

segments
List<Object>

路径段。

eval
Boolean

如果为 True,则计算生成的段。

返回

如果能够解析所有嵌套引用,则其值为 True。

适用于