43 references to ListBindingHelper
System.Windows.Forms (15)
System\Windows\Forms\DataBinding\BindingSource.cs (12)
674
return CreateBindingList(
ListBindingHelper
.GetListItemType(type));
718
PropertyDescriptorCollection dsProps =
ListBindingHelper
.GetListItemProperties(_dataSource);
908
currentValue =
ListBindingHelper
.GetList(dmProp.GetValue(cm.Current));
1084
object? list =
ListBindingHelper
.GetList(dataSourceInstance, _dataMember);
1127
Type type =
ListBindingHelper
.GetListItemType(_dataSource, _dataMember);
1157
if (
ListBindingHelper
.GetList(list) is not IList listInternal)
1183
_itemType =
ListBindingHelper
.GetListItemType(List);
1184
_itemShape =
ListBindingHelper
.GetListItemProperties(List);
1544
ListBindingHelper
.GetListName(List, listAccessors);
1548
object? ds =
ListBindingHelper
.GetList(_dataSource);
1552
return
ListBindingHelper
.GetListItemProperties(ds, _dataMember, listAccessors);
1556
return
ListBindingHelper
.GetListItemProperties(List, listAccessors);
System\Windows\Forms\DataBinding\CurrencyManager.cs (2)
134
internal override Type BindType =>
ListBindingHelper
.GetListItemType(List);
608
ListBindingHelper
.GetListItemProperties(_list, listAccessors);
System\Windows\Forms\DataBinding\PropertyManager.cs (1)
65
return
ListBindingHelper
.GetListItemProperties(_dataSource, listAccessors);
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\DesignBindingPicker.cs (2)
1098
PropertyDescriptorCollection properties =
ListBindingHelper
.GetListItemProperties(dataSourceInstance);
1197
PropertyDescriptorCollection properties =
ListBindingHelper
.GetListItemProperties(dataSourceInstance, [propertyDescriptor]);
System.Windows.Forms.Tests (26)
System\Windows\Forms\ListBindingHelperTests.cs (26)
35
Assert.Equal(expected,
ListBindingHelper
.GetList(list));
72
Assert.Equal(expected,
ListBindingHelper
.GetList(dataSource, dataMember));
86
Assert.Throws<ArgumentException>(() =>
ListBindingHelper
.GetList(dataSource, dataMember));
112
Assert.Equal(expected,
ListBindingHelper
.GetList(dataSource, dataMember));
177
Assert.Equal(expected,
ListBindingHelper
.GetListItemType(list));
178
Assert.Equal(list is null ? typeof(object) : expected,
ListBindingHelper
.GetListItemType(list, null));
179
Assert.Equal(list is null ? typeof(object) : expected,
ListBindingHelper
.GetListItemType(list, string.Empty));
218
Assert.Equal(expected,
ListBindingHelper
.GetListItemType(list, dataMember));
227
Assert.Throws<NotSupportedException>(() =>
ListBindingHelper
.GetListItemType(list));
228
Assert.Throws<NotSupportedException>(() =>
ListBindingHelper
.GetListItemType(list, null));
229
Assert.Throws<NotSupportedException>(() =>
ListBindingHelper
.GetListItemType(list, string.Empty));
230
Assert.Throws<NotSupportedException>(() =>
ListBindingHelper
.GetListItemType(list, "dataMember"));
291
IEnumerable<PropertyDescriptor> properties =
ListBindingHelper
.GetListItemProperties(list)?.Cast<PropertyDescriptor>();
295
properties =
ListBindingHelper
.GetListItemProperties(list, null)?.Cast<PropertyDescriptor>();
299
properties =
ListBindingHelper
.GetListItemProperties(list, Array.Empty<PropertyDescriptor>())?.Cast<PropertyDescriptor>();
303
properties =
ListBindingHelper
.GetListItemProperties(list, null, Array.Empty<PropertyDescriptor>())?.Cast<PropertyDescriptor>();
307
properties =
ListBindingHelper
.GetListItemProperties(list, string.Empty, Array.Empty<PropertyDescriptor>())?.Cast<PropertyDescriptor>();
409
IEnumerable<PropertyDescriptor> properties =
ListBindingHelper
.GetListItemProperties(list, listAccessors)?.Cast<PropertyDescriptor>();
413
properties =
ListBindingHelper
.GetListItemProperties(list, null, listAccessors)?.Cast<PropertyDescriptor>();
417
properties =
ListBindingHelper
.GetListItemProperties(list, string.Empty, listAccessors)?.Cast<PropertyDescriptor>();
435
IEnumerable<PropertyDescriptor> properties =
ListBindingHelper
.GetListItemProperties(list, dataMember, listAccessors)?.Cast<PropertyDescriptor>();
450
Assert.Throws<ArgumentException>(() =>
ListBindingHelper
.GetListItemProperties(list, dataMember, null));
456
Assert.Throws<TargetInvocationException>(() =>
ListBindingHelper
.GetListItemProperties(new DataClass(), TypeDescriptor.GetProperties(typeof(ListDataClass)).Cast<PropertyDescriptor>().ToArray()));
457
Assert.Throws<TargetInvocationException>(() =>
ListBindingHelper
.GetListItemProperties(new DataClass(), null, TypeDescriptor.GetProperties(typeof(ListDataClass)).Cast<PropertyDescriptor>().ToArray()));
458
Assert.Throws<TargetInvocationException>(() =>
ListBindingHelper
.GetListItemProperties(new DataClass(), string.Empty, TypeDescriptor.GetProperties(typeof(ListDataClass)).Cast<PropertyDescriptor>().ToArray()));
497
Assert.Equal(expected,
ListBindingHelper
.GetListName(list, listAccessors));