PropertyExtensionsGetPropertyValueT(IPropertyBagOwner, String, FuncT) Method |
Gets the property value. The property is searched in the provided owner, then in the containing folder, and then the hierarchy down to the built-in property bag.
Namespace: AltaxoAssembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public static T GetPropertyValue<T>(
this IPropertyBagOwner owner,
string propertyKeyString,
Func<T>? resultCreationIfNotFound = null
)
Parameters
- owner IPropertyBagOwner
- The owner of a property bag to start the search for the property. Then the other bags down the hierarchy are also searched for the property.
- propertyKeyString String
- The property key string.
- resultCreationIfNotFound FuncT (Optional)
- If the property is not found, a new property value can be created by this procedure. If this value is null, the default
value for this type of property value is returned.
Type Parameters
- T
- Type of the property value to be retrieved.
Return Value
TIf the property is found anywhere in the hierarchy of property bags, the property value of the topmost bag that contains the property is returned.
Otherwise, if
resultCreationIfNotFound is not null, the result of this procedure is returned. Else the default value of the type of property value is returned.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IPropertyBagOwner. 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).
See Also