System.Windows.Forms.ListBindingHelper.GetListItemPropertiesByType C# (CSharp) Méthode

GetListItemPropertiesByType() private static méthode

private static GetListItemPropertiesByType ( Type type, Array listAccessors, int startIndex ) : System.Windows.Forms.PropertyDescriptorCollection
type Type
listAccessors Array
startIndex int
Résultat System.Windows.Forms.PropertyDescriptorCollection
        private static PropertyDescriptorCollection GetListItemPropertiesByType(Type type, PropertyDescriptor[] listAccessors, int startIndex) {
            PropertyDescriptorCollection pdc = null;
            Type subType = listAccessors[startIndex].PropertyType;
            // subType is the property type - which is not to be confused with the item type.
            // For example, if a class Customer has a property of type Orders[], then Given:
            //        GetListItemProperties(typeof(Customer), PDForOrders)
            //      PDForOrders.PropertyType will be Array (not Orders)
            //
            //        If there are no more ListAccessors, then we want:
            //            GetListItemProperties(PDForOrders.PropertyType)  // this returns the shape of Orders not Array
            //        If there are more listAccessors, then we'll call
            //            GetListItemProperties(PDForOrders.PropertyType, listAccessors, startIndex++)
            startIndex = startIndex + 1;

            if (startIndex >= listAccessors.Length) {
                // Last item, return shape of item
                pdc = GetListItemProperties(subType);
            }
            else {
                // Walk down the tree
                pdc = GetListItemPropertiesByType(subType, listAccessors, startIndex);
            }
            // Return descriptors
            return pdc;
        }

Same methods

ListBindingHelper::GetListItemPropertiesByType ( Type type ) : System.Windows.Forms.PropertyDescriptorCollection
ListBindingHelper::GetListItemPropertiesByType ( Type type, Array listAccessors ) : System.Windows.Forms.PropertyDescriptorCollection