Method GetValueOrDefault
- Namespace
- Skyline.DataMiner.Core.DataMinerSystem.Common
- Assembly
- Skyline.DataMiner.Core.DataMinerSystem.Common.dll
GetValueOrDefault<T>(IDmsStandaloneParameter<T?>, T)
Gets the parameter value or the specified default value.
public static T GetValueOrDefault<T>(this IDmsStandaloneParameter<T?> parameter, T defaultValue) where T : struct
Parameters
parameter
IDmsStandaloneParameter<T?>The parameter.
defaultValue
TThe value to return if the HasValue property returns
false
.
Returns
- T
The parameter value.
Type Parameters
T
The type of the standalone parameter value.
Remarks
Make sure the element on which you perform the operation is active. If it is stopped, an ElementNotFoundException will be thrown.
Exceptions
- ArgumentNullException
parameter
is null.- ParameterNotFoundException
The parameter was not found.
- ElementNotFoundException
The element was not found in the DataMiner System.
GetValueOrDefault<T>(IDmsStandaloneParameter<T?>)
Gets the parameter value or the specified default value.
public static T GetValueOrDefault<T>(this IDmsStandaloneParameter<T?> parameter) where T : struct
Parameters
parameter
IDmsStandaloneParameter<T?>The parameter.
Returns
- T
The parameter value.
Type Parameters
T
The type of the standalone parameter value.
Remarks
Make sure the element on which you perform the operation is active. If it is stopped, an ElementNotFoundException will be thrown.
Exceptions
- ArgumentNullException
parameter
is null.- ParameterNotFoundException
The parameter was not found.
- ElementNotFoundException
The element was not found in the DataMiner System.