Dela via


JsonObject.GetNamedObject Method

Definition

Overloads

GetNamedObject(String)

Gets the JsonObject value with the specified name.

GetNamedObject(String, JsonObject)

Gets the JsonObject value with the specified name, or the provided default value if no such named value is found.

GetNamedObject(String)

Gets the JsonObject value with the specified name.

public:
 virtual JsonObject ^ GetNamedObject(Platform::String ^ name) = GetNamedObject;
JsonObject GetNamedObject(winrt::hstring const& name);
public JsonObject GetNamedObject(string name);
function getNamedObject(name)
Public Function GetNamedObject (name As String) As JsonObject

Parameters

name
String

Platform::String

winrt::hstring

The name.

Returns

The JsonObject value with the specified name.

Remarks

This method should always used with a try/catch block because it throws an exception if the name found is not a JsonObject type or the name is not found.

See also

Applies to

GetNamedObject(String, JsonObject)

Gets the JsonObject value with the specified name, or the provided default value if no such named value is found.

public:
 virtual JsonObject ^ GetNamedObject(Platform::String ^ name, JsonObject ^ defaultValue) = GetNamedObject;
/// [Windows.Foundation.Metadata.Overload("GetNamedObjectOrDefault")]
JsonObject GetNamedObject(winrt::hstring const& name, JsonObject const& defaultValue);
[Windows.Foundation.Metadata.Overload("GetNamedObjectOrDefault")]
public JsonObject GetNamedObject(string name, JsonObject defaultValue);
function getNamedObject(name, defaultValue)
Public Function GetNamedObject (name As String, defaultValue As JsonObject) As JsonObject

Parameters

name
String

Platform::String

winrt::hstring

The name.

defaultValue
JsonObject

The default value to use if the JSON property is not found.

Returns

The JsonObject with the specified name, or if this value wasn't found, the defaultValue is returned.

Attributes

See also

Applies to