Пример #1
0
 public SortFieldComparer(SortDescriptionCollection sortFields)
 {
     this._sortFields = sortFields;
     this._fields = CreatePropertyInfo(this._sortFields);
 }
Пример #2
0
 private static SortPropertyInfo[] CreatePropertyInfo(SortDescriptionCollection sortFields)
 {
     SortPropertyInfo[] infoArray = new SortPropertyInfo[sortFields.Count];
     for (int i = 0; i < sortFields.Count; i++)
     {
         SortDescription description = sortFields[i];
         infoArray[i].PropertyPath = description.PropertyName;
         SortDescription description2 = sortFields[i];
         infoArray[i].Descending = description2.Direction == ListSortDirection.Descending;
     }
     return infoArray;
 }
Пример #3
0
 private void SetSortDescriptions(SortDescriptionCollection descriptions)
 {
     if (this._sortDescriptions != null)
     {
         this._sortDescriptions.CollectionChanged -= new NotifyCollectionChangedEventHandler(this.SortDescriptionsChanged);
     }
     this._sortDescriptions = descriptions;
     if (this._sortDescriptions != null)
     {
         this._sortDescriptions.CollectionChanged += new NotifyCollectionChangedEventHandler(this.SortDescriptionsChanged);
     }
 }