Click or drag to resize
AttributeTableExtensionsGetValueOrDefaultT Method
Tries to get the value of the attribute with the specified key. If not found, the specified default value is returned.

Namespace: Slash.Collections.AttributeTables
Assembly: Slash.Collections (in Slash.Collections.dll) Version: 1.0.6018.40177
Syntax
public static T GetValueOrDefault<T>(
	this IAttributeTable attributeTable,
	Object key,
	T defaultValue
)
where T : class

Parameters

attributeTable
Type: Slash.Collections.AttributeTablesIAttributeTable
Attribute table to work on.
key
Type: SystemObject
Key to retrieve the value of.
defaultValue
Type: T
Default value to use if attribute wasn't found.

Type Parameters

T
Expected type of attribute. Only classes are allowed as the method wouldn't be AOT compatible otherwise.

Return Value

Type: T
Value of attribute with specified key, if found. Specified default value otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IAttributeTable. 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