| NamedObjectCollectionTTryGetTExpected Method (String, TExpected) |
Gets the object associated with the specified key. The object needs to be of a certain type.
Namespace: DigitalRune.CollectionsAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public bool TryGet<TExpected>(
string key,
out TExpected value
)
where TExpected : T
Public Function TryGet(Of TExpected As T) (
key As String,
<OutAttribute> ByRef value As TExpected
) As Boolean
public:
generic<typename TExpected>
where TExpected : T
bool TryGet(
String^ key,
[OutAttribute] TExpected% value
)
member TryGet :
key : string *
value : 'TExpected byref -> bool when 'TExpected : 'T
Parameters
- key
- Type: SystemString
The name of the element to get. - value
- Type: TExpected
The object associated with the specified key, if the key is found and the object is of type
TExpected; otherwise, the default value for
TExpected is returned. (This parameter is passed uninitialized.)
Type Parameters
- TExpected
- The expected type of the object.
Return Value
Type:
Boolean if the
NamedObjectCollectionT contains an element
with the specified key which is of the expected type; otherwise,
.
See Also