using
System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
namespace fanxing
{
public class SimpleDictionary : IDictionary
{
private DictionaryEntry[] items;
private Int32 ItemsInUse = 0;
public SimpleDictionary(Int32 numItems)
{
items = new DictionaryEntry[numItems];
}
public bool IsReadOnly { get { return false; } }
public bool Contains(object key)
{
Int32 index;
return TryGetIndexOfKey(key, out index);
}
public bool IsFixedSize { get { return false; } }
public void Remove(object key)
{
if (key == null) throw new ArgumentNullException("key");
Int32 index;
if (TryGetIndexOfKey(key, out index))
{
Array.Copy(items, index + 1, items, index, ItemsInUse - index - 1);
ItemsInUse--;
}
else
{
}
}
public
using System.Collections.Generic;
using System.Collections;
using System.Text;
namespace fanxing
{
public class SimpleDictionary : IDictionary
{
private DictionaryEntry[] items;
private Int32 ItemsInUse = 0;
public SimpleDictionary(Int32 numItems)
{
items = new DictionaryEntry[numItems];
}
public bool IsReadOnly { get { return false; } }
public bool Contains(object key)
{
Int32 index;
return TryGetIndexOfKey(key, out index);
}
public bool IsFixedSize { get { return false; } }
public void Remove(object key)
{
if (key == null) throw new ArgumentNullException("key");
Int32 index;
if (TryGetIndexOfKey(key, out index))
{
Array.Copy(items, index + 1, items, index, ItemsInUse - index - 1);
ItemsInUse--;
}
else
{
}
}
public