Sorts the items in the item collection.
Class: ItemCollectionClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET
public void Sort(); public void Sort( IComparer Comparer ); public void Sort( IComparer Comparer, bool Recursive );
Public Sub Sort() Public Sub Sort( ByVal Comparer As IComparer ) Public Sub Sort( ByVal Comparer As IComparer, ByVal Recursive As Boolean )
Comparer
Defines a method that compares two items or null/Nothing to use the SortAscending class implementation.
Recursive
Defines whether the dependents are also sorted, True to sort all direct and indirect dependents also, otherwise False. The default is False.
Sorts the items in the item collection.
Comparer implements a method that is used to compare two items. The sorting process calls this method repeatedly to sort the item collection. The method can sort items based on any of their attributes, even multiple keys.
Default implementations are available to sort cell text in a column ascending (SortAscending) or descending (SortDescending). If Comparer is null/Nothing, SortAscending is used with the ColumnsClass.FirstDisplayedAndVisibleIndex column.
private void LoadAssembly(Assembly asm) {
sftTree1.Initializing = true;
ItemCollectionClass itemCollection = sftTree1.ItemCollection;
itemCollection.Clear();
ListInfo(itemCollection, asm);
itemCollection.Sort();
sftTree1.Headers[0, 0].Text = asm.FullName;
sftTree1.Columns.MakeOptimal(0, true);
sftTree1.RecalcHorizontalExtent();
sftTree1.Initializing = false;
}
Private Sub LoadAssembly(ByVal asm As Assembly)
sftTree1.Initializing = True
Dim itemCollection As ItemCollectionClass = sftTree1.ItemCollection
itemCollection.Clear()
ListInfo(itemCollection, asm)
itemCollection.Sort()
sftTree1.Headers(0, 0).Text = asm.FullName
sftTree1.Columns.MakeOptimal(0, True)
sftTree1.RecalcHorizontalExtent()
sftTree1.Initializing = False
End Sub
See Also ItemCollectionClass Class | Classes | SftTree/NET 3.0