L
localhost
I have a HybridDictionary with a key containing an object array. It's
not matchng with the following code. What is a better way to do this.
HybridDictionary hd = new HybridDictionary(13);
object[] oneKey = new object[]{"a", 0 , "a" };
object[] oneValue = new object[]{"a", 0 , "a" };
object[] twoKey = new object[]{"b", 0 , "b" };
object[] twoValue = new object[]{"b", 0 , "b" };
hd.Add( oneKey , oneValue );
hd.Add( twoKey , twoValue );
object[] testKey = new object[]{"a", 0 , "a" };
IDictionaryEnumerator hdEnum = hd.GetEnumerator();
while( hdEnum.MoveNext() )
{
if ( testKey == (object[])hdEnum.Key )
{
Console.WriteLine("match.");
}
}
Thanks.
not matchng with the following code. What is a better way to do this.
HybridDictionary hd = new HybridDictionary(13);
object[] oneKey = new object[]{"a", 0 , "a" };
object[] oneValue = new object[]{"a", 0 , "a" };
object[] twoKey = new object[]{"b", 0 , "b" };
object[] twoValue = new object[]{"b", 0 , "b" };
hd.Add( oneKey , oneValue );
hd.Add( twoKey , twoValue );
object[] testKey = new object[]{"a", 0 , "a" };
IDictionaryEnumerator hdEnum = hd.GetEnumerator();
while( hdEnum.MoveNext() )
{
if ( testKey == (object[])hdEnum.Key )
{
Console.WriteLine("match.");
}
}
Thanks.