CSharpTest.Net
ContainsKey Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > LurchTable<TKey,TValue> Class : ContainsKey Method

key

Glossary Item Box

Determines whether the IDictionary contains an element with the specified key.

Syntax

Visual Basic (Declaration) 
Public Function ContainsKey( _
   ByVal key As TKey _
) As Boolean
C# 
public bool ContainsKey( 
   TKey key
)

Parameters

key

Exceptions

ExceptionDescription
System.ObjectDisposedExceptionThe exception that is thrown when an operation is performed on a disposed object.

Example

Library/Library.Test/TestLurchTable.cs

C#Copy Code
var test = new LurchTableTest<string, string>(StringComparer.OrdinalIgnoreCase);
test["a"] = "b";
Assert.IsTrue(test.ContainsKey("A"));

test = new LurchTableTest<string, string>(StringComparer.OrdinalIgnoreCase);
test["a"] = "b";
Assert.IsTrue(test.ContainsKey("A"));
VB.NETCopy Code
Dim test As var = New LurchTableTest(Of String, String)(StringComparer.OrdinalIgnoreCase)
test("a") = "b"
Assert.IsTrue(test.ContainsKey("A"))

test = New LurchTableTest(Of String, String)(StringComparer.OrdinalIgnoreCase)
test("a") = "b"
Assert.IsTrue(test.ContainsKey("A"))

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys