Share via


AtomicComposition.TryGetValue 方法

定义

获取一个由 SetValue(Object, Object) 方法保存的值。

重载

TryGetValue<T>(Object, T)

获取一个由 SetValue(Object, Object) 方法保存的值。

TryGetValue<T>(Object, Boolean, T)

获取一个由 SetValue(Object, Object) 方法保存的值,也可以选择不搜索父事务。

TryGetValue<T>(Object, T)

Source:
AtomicComposition.cs
Source:
AtomicComposition.cs
Source:
AtomicComposition.cs

获取一个由 SetValue(Object, Object) 方法保存的值。

public:
generic <typename T>
 bool TryGetValue(System::Object ^ key, [Runtime::InteropServices::Out] T % value);
public bool TryGetValue<T> (object key, out T value);
member this.TryGetValue : obj * 'T -> bool
Public Function TryGetValue(Of T) (key As Object, ByRef value As T) As Boolean

类型参数

T

要检索的值的类型。

参数

key
Object

要从中检索的键。

value
T

检索到的值。

返回

如果该值已成功检索,则为 true;否则为 false

适用于

TryGetValue<T>(Object, Boolean, T)

Source:
AtomicComposition.cs
Source:
AtomicComposition.cs
Source:
AtomicComposition.cs

获取一个由 SetValue(Object, Object) 方法保存的值,也可以选择不搜索父事务。

public:
generic <typename T>
 bool TryGetValue(System::Object ^ key, bool localAtomicCompositionOnly, [Runtime::InteropServices::Out] T % value);
public bool TryGetValue<T> (object key, bool localAtomicCompositionOnly, out T value);
member this.TryGetValue : obj * bool * 'T -> bool
Public Function TryGetValue(Of T) (key As Object, localAtomicCompositionOnly As Boolean, ByRef value As T) As Boolean

类型参数

T

要检索的值的类型。

参数

key
Object

要从中检索的键。

localAtomicCompositionOnly
Boolean

要排除父事务,则为 true;否则为 false

value
T

检索到的值。

返回

如果该值已成功检索,则为 true;否则为 false

适用于