Made the default library folders sorted
This commit is contained in:
parent
374a08b058
commit
5cce6e1f7a
3 changed files with 13 additions and 2 deletions
|
|
@ -148,9 +148,21 @@ namespace MatterHackers.MatterControl.Library
|
|||
public void RegisterRootProvider(ILibraryContainerLink containerItem)
|
||||
{
|
||||
libraryProviders.Add(containerItem);
|
||||
libraryProviders.Sort(SortOnName);
|
||||
OnLibraryItemsChanged();
|
||||
}
|
||||
|
||||
private int SortOnName(ILibraryContainerLink x, ILibraryContainerLink y)
|
||||
{
|
||||
if (x != null && x.Name != null
|
||||
&& y != null && y.Name != null)
|
||||
{
|
||||
return string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void RegisterCreator(ILibraryContentItem libraryItem)
|
||||
{
|
||||
this.RootLibaryContainer.Items.Add(libraryItem);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue