Share via


PropertyBag.GetValue Method

Definition

Returns the value with the specified key, cast as the specified type.

Overloads

GetValue<T>(Int32)

Returns the value with the specified key, cast as the specified type.

GetValue<T>(Int32, T)

Returns the value with the specified key, cast as the specified type, or the specified default value if no item with the specified key is located in the collection.

GetValue<T>(Int32)

Returns the value with the specified key, cast as the specified type.

public:
generic <typename T>
 T GetValue(int index);
public T GetValue<T> (int index);
member this.GetValue : int -> 'T
Public Function GetValue(Of T) (index As Integer) As T

Type Parameters

T

The desired type of the returned value.

Parameters

index
Int32

The key of the item to return.

Returns

T

The value for the specified key, if one exists, cast to type T.

Applies to

GetValue<T>(Int32, T)

Returns the value with the specified key, cast as the specified type, or the specified default value if no item with the specified key is located in the collection.

public:
generic <typename T>
 T GetValue(int index, T defaultValue);
public T GetValue<T> (int index, T defaultValue);
member this.GetValue : int * 'T -> 'T
Public Function GetValue(Of T) (index As Integer, defaultValue As T) As T

Type Parameters

T

The desired type of the return value.

Parameters

index
Int32

The key of the item to return.

defaultValue
T

The default value (of type T) to return if the key is not found.

Returns

T

The value for the specified key, if one exists, cast to type T.

Applies to