Connectivity Software User's Guide and Reference
IsValidExternalValue(Object,Boolean) Method



OpcLabs.EasyOpcUAPrimitives Assembly > OpcLabs.EasyOpc.UA.PubSub Namespace > UAPublisherId Class > IsValidExternalValue Method : IsValidExternalValue(Object,Boolean) Method
The value to be tested.

The value of this parameter can be null (Nothing in Visual Basic).

If true, zero numeric values and empty strings are considered valid (treated as null); if false, strict validation is applied.
Determines whether an object represents a valid external value of a publisher Id.
Syntax
'Declaration
 
<JetBrains.Annotations.MustUseReturnValueAttribute()>
<JetBrains.Annotations.PureAttribute()>
Public Overloads Shared Function IsValidExternalValue( _
   ByVal value As Object, _
   ByVal relaxed As Boolean _
) As Boolean
'Usage
 
Dim value As Object
Dim relaxed As Boolean
Dim value As Boolean
 
value = UAPublisherId.IsValidExternalValue(value, relaxed)
[JetBrains.Annotations.MustUseReturnValue()]
[JetBrains.Annotations.Pure()]
public static bool IsValidExternalValue( 
   object value,
   bool relaxed
)
[JetBrains.Annotations.MustUseReturnValue()]
[JetBrains.Annotations.Pure()]
public:
static bool IsValidExternalValue( 
   Object^ value,
   bool relaxed
) 

Parameters

value
The value to be tested.

The value of this parameter can be null (Nothing in Visual Basic).

relaxed
If true, zero numeric values and empty strings are considered valid (treated as null); if false, strict validation is applied.

Return Value

Returns true if the value represents a valid external value of a publisher Id; returns false otherwise.

This return value of this method should not be ignored.

Remarks

External value is a CLS-compliant value used e.g. when accessing the publisher ID over $(typeUrl. It is System.Byte, System.Int32, System.Int64, System.Decimal, System.String, or null.

The following external values are valid:

When relaxed is false (strict validation), zero numeric values and empty strings are invalid. When relaxed is true, zero numeric values and empty strings are treated as equivalent to null and are considered valid.

This method is pure, i.e. it does not have observable side effects.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also