public Object this[Object key]
{
get
{
// look for matching key in extra data list
foreach (DictionaryEntry entry in _extraData)
{
if (entry.Key.Equals(key))
return entry.Value;
}
// entry not found
return null;
} // get
set
{
if (_extraData == null)
{
_extraData = new DictionaryEntry[1];
_extraData[0] = new DictionaryEntry(key, value);
}
else
{
int length =_extraData.Length;
DictionaryEntry[] newList = new DictionaryEntry[length + 1];
int co = 0;
for (; co < length; co++)
newList[co] = _extraData[co];
newList[co] = new DictionaryEntry(key, value); // set last value
_extraData = newList;
}
} // set
} // Object this[Object key]