|
|
От: |
V.Petrovski
|
|
| Дата: | 07.07.04 11:58 | ||
| Оценка: | 2 (1) | ||
Вывод:
А вообще-то это твая имплементация GetStandardValues ошибочная.
MSDN : Returns a collection of standard values for the data type this type converter is designed for.
public void DoubleClickRow(int row, bool toggleExpand, int type)
{
GridEntry entry = this.GetGridEntryFromRow(row);
... //здесь нет ничего интересного
// получить индекс текущего элемента
int index = this.GetCurrentValueIndex(entry);
if (index != -1) // элемент выбран
{
// получить список доступных объектов
// обратите внимание от куда получаем список
object[] array = entry.GetPropertyValueList();
// установить новый индекс
if (index >= (array.Length - 1))
index = 0;
else
index += 1;
// а теперь внимание !!! и что мы пытаемся присвоить ???
CommitValue(array[index]);// в конечном итоге приходим у вызову propertyInfo.SetValue(PropertyOwner, value);
// выбрать строку
SelectRow(this.selectedRow);
//выход из функции
return;
}
... //здесь нет ничего интересного
}
public virtual object[] GetPropertyValueList()
{
ICollection collection = this.TypeConverter.GetStandardValues(this);
if (collection != null)
{
object[] array = new object[collection.Count];
collection.CopyTo(array, 0);
return array;
}
return new object[0];
}