Click or drag to resize

PropertyExtensionsGetPropertyValueT(IPropertyBagOwner, PropertyKeyT, 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: Altaxo
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static T GetPropertyValue<T>(
	this IPropertyBagOwner owner,
	PropertyKey<T> p,
	Func<T>? resultCreationIfNotFound
)

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.
p  PropertyKeyT
The property key.
resultCreationIfNotFound  FuncT
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

T
If 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