PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor [] listAccessors)
            {
                ICollection viewNames = this [0].GetViewNames();

                PropertyDescriptor [] a = new PropertyDescriptor [viewNames.Count];
                int i = 0;

                foreach (string viewName in viewNames)
                {
                    a[i++] = new ListSourcePropertyDescriptor(viewName, null);
                }
                return(new PropertyDescriptorCollection(a));
            }
 PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors) {
     if (_dataSource != null) {
         ICollection viewNames = _dataSource.GetViewNames();
         if (viewNames != null && viewNames.Count > 0) {
             string[] viewNamesArray = new string[viewNames.Count];
             viewNames.CopyTo(viewNamesArray, 0);
             PropertyDescriptor[] props = new PropertyDescriptor[viewNames.Count];
             for (int i = 0; i < viewNamesArray.Length; i++) {
                 props[i] = new ListSourcePropertyDescriptor(viewNamesArray[i]);
             }
             return new PropertyDescriptorCollection(props);
         }                    
     }
     return new PropertyDescriptorCollection(null);
 }
Beispiel #3
0
 PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)
 {
     if (_dataSource != null)
     {
         ICollection viewNames = _dataSource.GetViewNames();
         if (viewNames != null && viewNames.Count > 0)
         {
             string[] viewNamesArray = new string[viewNames.Count];
             viewNames.CopyTo(viewNamesArray, 0);
             PropertyDescriptor[] props = new PropertyDescriptor[viewNames.Count];
             for (int i = 0; i < viewNamesArray.Length; i++)
             {
                 props[i] = new ListSourcePropertyDescriptor(viewNamesArray[i]);
             }
             return(new PropertyDescriptorCollection(props));
         }
     }
     return(new PropertyDescriptorCollection(null));
 }