File tree Expand file tree Collapse file tree
PerformanceCalculatorGUI/Screens Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44#nullable enable
55using System ;
6+ using System . Collections . Generic ;
67using System . IO ;
78using System . Linq ;
89using System . Security . Cryptography ;
@@ -340,18 +341,25 @@ private void loadCollectionList()
340341
341342 collectionList . Clear ( ) ;
342343
344+ var collections = new List < Collection > ( ) ;
345+
343346 foreach ( string collectionFile in Directory . EnumerateFiles ( collections_directory ) )
344347 {
345348 var deserializedCollection = JsonConvert . DeserializeObject < Collection > ( File . ReadAllText ( collectionFile ) ) ;
346349
347350 if ( deserializedCollection != null )
348351 {
349- var collectionButton = new CollectionButton ( deserializedCollection , currentCollection ) ;
350- collectionList . Add ( collectionButton ) ;
351-
352- collectionButton . OnDelete += onCollectionDelete ;
352+ collections . Add ( deserializedCollection ) ;
353353 }
354354 }
355+
356+ foreach ( var collection in collections . OrderBy ( x => x . Name ) )
357+ {
358+ var collectionButton = new CollectionButton ( collection , currentCollection ) ;
359+ collectionList . Add ( collectionButton ) ;
360+
361+ collectionButton . OnDelete += onCollectionDelete ;
362+ }
355363 }
356364
357365 private void onCollectionDelete ( Collection collection )
You can’t perform that action at this time.
0 commit comments