IBooleanParameterExtensions Class#
Inheritance Hierarchy#
System.Object
Basler.Pylon.IBooleanParameterExtensions
Syntax#
C#
VB
The IBooleanParameterExtensions type exposes the following members.
Methods#
Name | Description | |
---|---|---|
GetValueOrDefault | Gets the parameter value if the parameter is readable. Otherwise, returns the default value. | |
TrySetValue | Sets the provided boolean value if the parameter is writable. |
IBooleanParameterExtensions.GetValueOrDefault Method#
Gets the parameter value if the parameter is readable. Otherwise, returns the default value.
Syntax#
C#
VB
<ExtensionAttribute>
Public Shared Function GetValueOrDefault (
parameter As IBooleanParameter,
defaultValue As Boolean
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IBooleanParameter
The interface of the parameter. - defaultValue
- Type: System.Boolean
The default value returned if the parameter is not readable.
Return Value#
Type: Boolean
Returns the parameter value if the parameter is readable. Otherwise, returns the default value.
Usage Note#
In Visual Basic and C#, you can call this method as an instance method on any object of type IBooleanParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks#
Thread Safety: This method is synchronized with the source of the parameter collection, if any.
Error Safety: Can throw exceptions if reading the value fails.
IBooleanParameterExtensions.TrySetValue Method#
Sets the provided boolean value if the parameter is writable.
Syntax#
C#
VB
<ExtensionAttribute>
Public Shared Function TrySetValue (
parameter As IBooleanParameter,
value As Boolean
) As Boolean
Parameters#
- parameter
- Type: Basler.Pylon.IBooleanParameter
The interface of the parameter. - value
- Type: System.Boolean
The boolean value to set.
Return Value#
Type: Boolean
Returns false if the parameter is not writable.
Usage Note#
In Visual Basic and C#, you can call this method as an instance method on any object of type IBooleanParameter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks#
Thread Safety: This method is synchronized with the source of the parameter collection, if any.
Error Safety: Can throw exceptions if the preconditions are not met or if writing the value fails.