IPersistableObjectGetPropertyOrDefaultT Method
Gets the specified property if it exists in the inner storage and has a compatibly type with T; otherwise, returns defaultValue.
Namespace: KGySoft.ComponentModelAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
T GetPropertyOrDefault<T>(
string propertyName,
T defaultValue = null
)
Function GetPropertyOrDefault(Of T) (
propertyName As String,
Optional defaultValue As T = Nothing
) As T
generic<typename T>
T GetPropertyOrDefault(
String^ propertyName,
T defaultValue = nullptr
)
abstract GetPropertyOrDefault :
propertyName : string *
?defaultValue : 'T
(* Defaults:
let _defaultValue = defaultArg defaultValue null
*)
-> 'T
- propertyName String
- The name of the property to get.
- defaultValue T (Optional)
- The default value to return if property does not exist or has an incompatible type with T. This parameter is optional.
Default value: if T is a reference type; otherwise, the bitwise zero value of T.
- T
- Type of the property to return.
TThe found property value or
defaultValue if
propertyName was not found in this
IPersistableObject.