Table of Contents

TryGetValue

Methods
public bool TryGetValue(Key key, out Value value)

Gets the value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

Value value

When this method returns, contains the value associated with the specified key, if found; otherwise, None.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains an element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out bool value)

Gets the bool value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

bool value

When this method returns, contains the bool value associated with the specified key, if found; otherwise, false.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a bool element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out int value)

Gets the int value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

int value

When this method returns, contains the int value associated with the specified key, if found; otherwise, 0.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains an int element with the specified key; otherwise, false.

public bool TryGetValue<TValue>(Key key, out TValue value)

Gets the value of type associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

TValue value

When this method returns, contains the value associated with the specified key, if found; otherwise, the default value of .

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains an element of type with the specified key; otherwise, false.

Type Parameters
Name Description
TValue
public bool TryGetValue(Key key, out string value)

Gets the string value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

string value

When this method returns, contains the string value associated with the specified key, if found; otherwise, null.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a string element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out float value)

Gets the float value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

float value

When this method returns, contains the float value associated with the specified key, if found; otherwise, 0f.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a float element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out double value)

Gets the double value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

double value

When this method returns, contains the double value associated with the specified key, if found; otherwise, 0d.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a double element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out short value)

Gets the short value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

short value

When this method returns, contains the short value associated with the specified key, if found; otherwise, 0.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a short element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out byte value)

Gets the byte value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

byte value

When this method returns, contains the byte value associated with the specified key, if found; otherwise, 0.

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a byte element with the specified key; otherwise, false.

public bool TryGetValue(Key key, out Enum value)

Gets the Enum value associated with the specified key.

Parameters
Type Name Description
Key key

The key of the value to get.

Enum value

When this method returns, contains the Enum value associated with the specified key, if found; otherwise, null

This parameter is passed uninitialized.

Returns
Type Description
bool

true if the storage object contains a Enum element with the specified key; otherwise, false.