JsonObject.GetNamedBoolean Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
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
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)
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
bool
The Boolean with the specified name, or if this value wasn't found, the defaultValue is returned.
- Attributes