Skip to content

IBooleanParameterExtensions Class#

Extension class for the boolean parameter interface.

Inheritance Hierarchy#

System.Object
  Basler.Pylon.IBooleanParameterExtensions

Syntax#

C#

public static class IBooleanParameterExtensions

VB

<ExtensionAttribute>
Public NotInheritable Class IBooleanParameterExtensions

The IBooleanParameterExtensions type exposes the following members.

Methods#

 NameDescription
Public methodStatic memberGetValueOrDefault Gets the parameter value if the parameter is readable. Otherwise, returns the default value.
Public methodStatic memberTrySetValue 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#

public static bool GetValueOrDefault(
    this IBooleanParameter parameter,
    bool defaultValue
)

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#

public static bool TrySetValue(
    this IBooleanParameter parameter,
    bool value
)

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.