T
The type of the default value and which to parse the string value into.
Keysight Pathwave 89600 VSA .NET API
GetParsedValueOrDefault<T> Method
See Also 
Agilent.SA.Vsa.Interfaces Assembly > Agilent.SA.Vsa Namespace > CapabilityReadOnlyDictionary Class : GetParsedValueOrDefault<T> Method


key
The key of the value to be parsed.
defaultValue
A default value to be returned if the key cannot be found or the value associated with the key cannot be parsed into the specified type.

Glossary Item Box

Gets the value associated with the specified key or a default value if the key is not found or if the value found for that key cannot be parsed into the specified type.

Syntax

Visual Basic (Declaration) 
Public Function GetParsedValueOrDefault(Of T As {New, Struct})( _
   ByVal key As String, _
   ByVal defaultValue As T _
) As T
C# 
public T GetParsedValueOrDefault<T>( 
   string key,
   T defaultValue
)
where T: new(), struct
C++/CLI 
public:
T^ GetParsedValueOrDefaultgeneric<typename T>
( 
   String^ key,
   T^ defaultValue
) 
where T: gcnew(), value class

Parameters

key
The key of the value to be parsed.
defaultValue
A default value to be returned if the key cannot be found or the value associated with the key cannot be parsed into the specified type.

Type Parameters

T
The type of the default value and which to parse the string value into.

Return Value

When the method is successful, the returned value is the value associated with the specified key. When the method fails, it returns defaultValue.

Exceptions

ExceptionDescription
System.NotSupportedExceptionIf the type of T used is not supported.

Requirements

Target Platforms: Windows 11 Professional or Enterprise; Windows 10 Professional, Enterprise, or Education (64-bit)

See Also