Example #1
0
 /// <summary>
 /// Sorts the list using the given comparer./>
 /// </summary>
 public void Sort(IComparer <T> comparer)
 {
     using (DeferredUpdate())
         using (Lock.WriteUsing())
         {
             Backing.Sort(comparer);
         }
     OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move));
 }
Example #2
0
 /// <summary>
 /// Sorts the list using the given selector and comparer./>
 /// </summary>
 public void Sort <TKey>(Func <T, TKey> selector, IComparer <TKey> comparer = null)
 {
     using (DeferredUpdate())
         using (Lock.WriteUsing())
         {
             comparer = comparer ?? Comparer <TKey> .Default;
             Backing.Sort(new TransformComparer <T, TKey>(selector, comparer));
         }
     OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Move));
 }