JsonObject.IDictionary<String,JsonNode>.TryGetValue 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与指定属性名称关联的值。
virtual bool System.Collections.Generic.IDictionary<System.String,System.Text.Json.Nodes.JsonNode>.TryGetValue(System::String ^ propertyName, [Runtime::InteropServices::Out] System::Text::Json::Nodes::JsonNode ^ % jsonNode) = System::Collections::Generic::IDictionary<System::String ^, System::Text::Json::Nodes::JsonNode ^>::TryGetValue;
bool IDictionary<string,JsonNode>.TryGetValue (string propertyName, out System.Text.Json.Nodes.JsonNode jsonNode);
abstract member System.Collections.Generic.IDictionary<System.String,System.Text.Json.Nodes.JsonNode>.TryGetValue : string * JsonNode -> bool
override this.System.Collections.Generic.IDictionary<System.String,System.Text.Json.Nodes.JsonNode>.TryGetValue : string * JsonNode -> bool
Function TryGetValue (propertyName As String, ByRef jsonNode As JsonNode) As Boolean Implements IDictionary(Of String, JsonNode).TryGetValue
参数
- propertyName
- String
要获取的值的属性名称。
- jsonNode
- JsonNode
此方法返回时,如果找到属性名称,则包含与指定属性名称关联的值;否则,为 null
.
返回
true
JsonObject如果包含具有指定属性名称的元素,则为 ;否则为 false
。
例外
propertyName
为 null
。