Edit

Share via


ServiceHealthBehavior.TryParseBooleanQueryParameter Method

Definition

Attempts to parse a Boolean query string parameter and returns a value that indicates whether the parsing operation succeeded.

protected:
 static bool TryParseBooleanQueryParameter(System::String ^ parameterName, System::String ^ parameter, bool defaultValue, [Runtime::InteropServices::Out] bool % result);
protected static bool TryParseBooleanQueryParameter (string parameterName, string parameter, bool defaultValue, out bool result);
static member TryParseBooleanQueryParameter : string * string * bool * bool -> bool
Protected Shared Function TryParseBooleanQueryParameter (parameterName As String, parameter As String, defaultValue As Boolean, ByRef result As Boolean) As Boolean

Parameters

parameterName
String

The name of the parameter whose value the method attempts to parse.

parameter
String

The field/value pair of the query string.

defaultValue
Boolean

The value to be assigned to the result argument if the parsing operation fails.

result
Boolean

When the method returns, the value of the parsed Boolean argument.

Returns

true if the parsing operation succeeded; otherwise, false.

Exceptions

parameterName is null.

-or-

parameter is null.

Remarks

The method returns true if the value of the field was successfully parsed by the Boolean.TryParse method.

Applies to