Exemple #1
0
        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");
        }
Exemple #2
0
 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);
 }
Exemple #3
0
 public string GetListName(PropertyDescriptor[] listAccessors)
 {
     return(ListBindingHelper.GetListName((object)this, listAccessors));
 }
Exemple #4
0
 // ITypedList
 public string GetListName(PropertyDescriptor[] listAccessors)
 {
     return(ListBindingHelper.GetListName(source, listAccessors));
 }