NameScope.TryGetValue(String, Object) 方法

定義

取得與指定索引鍵關聯的值。

public:
 virtual bool TryGetValue(System::String ^ key, [Runtime::InteropServices::Out] System::Object ^ % value);
public bool TryGetValue (string key, out object value);
abstract member TryGetValue : string * obj -> bool
override this.TryGetValue : string * obj -> bool
Public Function TryGetValue (key As String, ByRef value As Object) As Boolean

參數

key
String

要取得之值的索引鍵。

value
Object

這個方法傳回時,如果找到索引鍵,則包含與指定之索引鍵關聯的值,否則為 null 物件。 這個參數會以未初始化的狀態傳遞。

傳回

Boolean

如果 NameScope 包含作為 key 所提供名稱的對應,則為 true。 否則為 false

適用於