public void GetListNameTest() { List <int> list = new List <int> (); int [] arr = new int [0]; SimpleItem item = new SimpleItem(); Assert.AreEqual(typeof(int).Name, ListBindingHelper.GetListName(list, null), "1"); Assert.AreEqual(typeof(int).Name, ListBindingHelper.GetListName(arr, null), "2"); Assert.AreEqual(typeof(SimpleItem).Name, ListBindingHelper.GetListName(item, null), "3"); Assert.AreEqual(String.Empty, ListBindingHelper.GetListName(null, null), "4"); }
protected virtual void Initialize() { if (this.list is ITypedList) { this.properties = ((ITypedList)this.list).GetItemProperties((PropertyDescriptor[])null); this.name = ((ITypedList)this.list).GetListName((PropertyDescriptor[])null); } else if (this.list is IEnumerable) { this.properties = ListBindingHelper.GetListItemProperties(this.list); this.name = ListBindingHelper.GetListName(this.list, (PropertyDescriptor[])null); } this.BuildChildren(this); }
public string GetListName(PropertyDescriptor[] listAccessors) { return(ListBindingHelper.GetListName((object)this, listAccessors)); }
// ITypedList public string GetListName(PropertyDescriptor[] listAccessors) { return(ListBindingHelper.GetListName(source, listAccessors)); }