JsonObject.GetNamedBoolean Method

Definition

Overloads

GetNamedBoolean(String)

Gets the Boolean value with the specified name.

GetNamedBoolean(String, Boolean)

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

GetNamedBoolean(String)

Gets the Boolean value with the specified name.

public:
 virtual bool GetNamedBoolean(Platform::String ^ name) = GetNamedBoolean;
bool GetNamedBoolean(winrt::hstring const& name);
public bool GetNamedBoolean(string name);
function getNamedBoolean(name)
Public Function GetNamedBoolean (name As String) As Boolean

Parameters

name
String

Platform::String

winrt::hstring

The name.

Returns

Boolean

bool

The Boolean 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 Boolean type or the name is not found.

See also

Applies to

GetNamedBoolean(String, Boolean)

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

public:
 virtual bool GetNamedBoolean(Platform::String ^ name, bool defaultValue) = GetNamedBoolean;
/// [Windows.Foundation.Metadata.Overload("GetNamedBooleanOrDefault")]
bool GetNamedBoolean(winrt::hstring const& name, bool const& defaultValue);
[Windows.Foundation.Metadata.Overload("GetNamedBooleanOrDefault")]
public bool GetNamedBoolean(string name, bool defaultValue);
function getNamedBoolean(name, defaultValue)
Public Function GetNamedBoolean (name As String, defaultValue As Boolean) As Boolean

Parameters

name
String

Platform::String

winrt::hstring

The name.

defaultValue
Boolean

bool

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

Returns

Boolean

bool

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

Attributes

See also

Applies to