Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

LoadTestContext::TryGetValue Method (String^, Object^)

 

Gets the value that is associated with the specified key.

Namespace:   Microsoft.VisualStudio.TestTools.LoadTesting
Assembly:  Microsoft.VisualStudio.QualityTools.LoadTestFramework (in Microsoft.VisualStudio.QualityTools.LoadTestFramework.dll)

public:
virtual bool TryGetValue(
	String^ key,
	[OutAttribute] Object^% value
) sealed

Parameters

key
Type: System::String^

The key to find.

value
Type: System::Object^

The referenced object that obtains the value of the key, if it is found; otherwise, it obtains the default value for the type of the value parameter. This parameter can be passed uninitialized.

Return Value

Type: System::Boolean

true if it contains an element that has the specified key; otherwise, false.

Exception Condition
ArgumentNullException

key is null.

This is the most efficient way to try to obtain values if many tried keys are not in the dictionary. This method combines the functionality of the ContainsKey method and the Item property.

If the key is not found, the out value parameter gets the appropriate default value: zero for integer types, false for Boolean types, and null for reference types.

Return to top
Show: