/// <summary>
/// Sorts the view of the underlying list based on the given <see cref="T:System.ComponentModel.ListSortDescriptionCollection"></see>.
/// </summary>
/// <param name="sorts">The <see cref="T:System.ComponentModel.ListSortDescriptionCollection"></see> containing the sorts to apply to the view.</param>
public void ApplySort(ListSortDescriptionCollection sorts)
{
Lock();
try
{
ListSortDescriptionCollection proposed;
if (sorts == null)
proposed = new ListSortDescriptionCollection();
else
{
foreach (ListSortDescription desc in sorts)
ValidateProperty(desc.PropertyDescriptor);
ListSortDescription[] props = new ListSortDescription[sorts.Count];
sorts.CopyTo(props, 0);
proposed = new ListSortDescriptionCollection(props);
}
this.SortProperties = proposed;
}
finally
{
Unlock();
}
RaiseEvents();
}