 | AttributeTableExtensionsTryGetValueT Method (IAttributeTable, Object, T) |
Tries to retrieve the value the specified key is mapped to within this
attribute table. Additionally checks that the type of the value is correct.
Only classes are allowed as the method wouldn't be AOT compatible otherwise.
Namespace: Slash.Collections.AttributeTablesAssembly: Slash.Collections (in Slash.Collections.dll) Version: 1.0.6018.40177
Syntaxpublic static bool TryGetValue<T>(
this IAttributeTable attributeTable,
Object key,
out T value
)
where T : class
<ExtensionAttribute>
Public Shared Function TryGetValue(Of T As Class) (
attributeTable As IAttributeTable,
key As Object,
<OutAttribute> ByRef value As T
) As Boolean
public:
[ExtensionAttribute]
generic<typename T>
where T : ref class
static bool TryGetValue(
IAttributeTable^ attributeTable,
Object^ key,
[OutAttribute] T% value
)
[<ExtensionAttribute>]
static member TryGetValue :
attributeTable : IAttributeTable *
key : Object *
value : 'T byref -> bool when 'T : not struct
Parameters
- attributeTable
- Type: Slash.Collections.AttributeTablesIAttributeTable
Attribute table to work on. - key
- Type: SystemObject
Key to retrieve the value of. - value
- Type: T
Retrieved value.
Type Parameters
- T
- Expected type of value.
Return Value
Type:
Boolean true if a value was found, and false 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