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