Click or drag to resize

SettingsBaseGetAttributeValueTAttribute, TValue Method

Attempts to find specified attribute and return specified value.

Namespace: GSF.Configuration
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.253-beta+ffb7163c9e3b771705bc5b9aa3f09870f2cb9e2c
Syntax
[EditorBrowsableAttribute(EditorBrowsableState.Advanced)]
protected TValue GetAttributeValue<TAttribute, TValue>(
	string name,
	TValue defaultValue,
	Func<TAttribute, TValue> attributeValue
)
where TAttribute : Attribute
View Source

Parameters

name  String
Name of field or property to search for attribute.
defaultValue  TValue
Default value to return if attribute doesn't exist.
attributeValue  FuncTAttribute, TValue
Function delegate used to return desired attribute property.

Type Parameters

TAttribute
Type of Attribute to find.
TValue
Type of value attribute delegate returns.

Return Value

TValue
Specified attribute value if it exists; otherwise default value.
See Also