Represents a CSV field property descriptor.
Inheritance: System.ComponentModel.PropertyDescriptor
Esempio n. 1
0
        public void ApplySort(PropertyDescriptor property, System.ComponentModel.ListSortDirection direction)
        {
            _sort      = (CsvPropertyDescriptor)property;
            _direction = direction;

            _csv.ReadToEnd();

            _csv.Records.Sort(new CsvRecordComparer(_sort.Index, _direction));
        }
Esempio n. 2
0
        public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors)
        {
            if (_properties == null)
            {
                var properties = new PropertyDescriptor[_csv.FieldCount];

                for (var i = 0; i < properties.Length; i++)
                {
                    properties[i] = new CsvPropertyDescriptor(((System.Data.IDataReader)_csv).GetName(i), i);
                }

                _properties = new PropertyDescriptorCollection(properties);
            }

            return(_properties);
        }
Esempio n. 3
0
 public void RemoveSort()
 {
     _sort      = null;
     _direction = ListSortDirection.Ascending;
 }