public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            int column = owner.Array.Shape[owner.ColumnDimension];
            Type type = typeof(object);

            if(owner.Array.GetType().IsGenericType) // IMultiDimensionalArray<T>
            {
                type = owner.Array.GetType().GetGenericArguments()[0];
            }

            var propertyDescriptors = new PropertyDescriptor[column];
            for (int i = 0; i < column; i++)
            {
                propertyDescriptors[i] = new MultiDimensionaArrayPropertyDescriptor(owner.ColumnNames[i], type, i);
            }
        
            return new PropertyDescriptorCollection(propertyDescriptors);
        }
Exemplo n.º 2
0
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            int  column = owner.Array.Shape[owner.ColumnDimension];
            Type type   = typeof(object);

            if (owner.Array.GetType().IsGenericType) // IMultiDimensionalArray<T>
            {
                type = owner.Array.GetType().GetGenericArguments()[0];
            }

            var propertyDescriptors = new PropertyDescriptor[column];

            for (int i = 0; i < column; i++)
            {
                propertyDescriptors[i] = new MultiDimensionaArrayPropertyDescriptor(owner.ColumnNames[i], type, i);
            }

            return(new PropertyDescriptorCollection(propertyDescriptors));
        }