singalen: (Default)
[personal profile] singalen

Originally published at Fiberglass flowers. You can comment here or there.

Whenever you implement own datasource for .NET GUI binding, you’lll have the choice - whether to implement IList or IListSource.

IListSource is a simplistic interface with two members: IList<T> GetList() and bool ContainsListCollection;

MSDN help about IListSource.ContainsListCollection states it’s “indicating whether the collection is a collection of IList objects”.
MSDN is not true here.

If IListSource.ContainsListCollection is false, GetList() just returns your IList.

If IListSource.ContainsListCollection is true, GetList() is expected to return ITypedList, which needs to provide a collection of PropertyDescriptor-s for every field of your collection.
Its purpose is to provide field names (including by-name field access) in runtime.

Quoted below is a code piece from a Microsoft newsgroup that resolves both cases to a data list (field values list, in second case).

And yes, if you’re planning to mutate the UI-bound collection, use IBindingList<> instead of IList<>.

Read the rest of this entry »

Tags:

(no subject)

9/10/08 08:14 (UTC)
Posted by [identity profile] profuel.livejournal.com
спасибо
я таки не понял, зачем было после этого утверждения какой-то пример приводить.

По-моему тут проблема не в описании, а в реализации этого свойства у конкретных классов/интерфейсов.

(no subject)

9/10/08 09:05 (UTC)
Posted by [identity profile] profuel.livejournal.com
ааа, выходит статья вообще о другом. ну спасибо, буду знать. Но пока не натыкался на такие грабли.