public object this[int index] {
get {
if (valueArray != null) {
return valueArray.GetValue(index);
}
IList list = values as IList;
if (list != null) {
return list[index];
}
// No other choice but to enumerate the collection.
//
valueArray = new object[values.Count];
values.CopyTo(valueArray, 0);
return valueArray.GetValue(index);
}
}