File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1- using System . Collections ;
1+ using System . Collections ;
22using System . Collections . Generic ;
33using System . ComponentModel ;
44using System . Diagnostics . Contracts ;
@@ -128,6 +128,10 @@ public int Compare(object x, object y)
128128 {
129129 return compare . Compare ( en1 . Text , en2 . Text ) ;
130130 }
131+ if ( x is TreeNode tn1 && tn1 . Parent == null && y is TreeNode tn2 && tn2 . Parent == null )
132+ {
133+ return ( int ) tn1 . Tag - ( int ) tn2 . Tag ;
134+ }
131135
132136 return 0 ;
133137 }
@@ -224,7 +228,8 @@ public ClassNodeView()
224228 {
225229 Text = "Classes" ,
226230 ImageIndex = 0 ,
227- SelectedImageIndex = 0
231+ SelectedImageIndex = 0 ,
232+ Tag = 0
228233 } ;
229234
230235 classesTreeView . Nodes . Add ( classesRootNode ) ;
@@ -233,7 +238,8 @@ public ClassNodeView()
233238 {
234239 Text = "Enums" ,
235240 ImageIndex = 2 ,
236- SelectedImageIndex = 2
241+ SelectedImageIndex = 2 ,
242+ Tag = 1
237243 } ;
238244
239245 classesTreeView . Nodes . Add ( enumsRootNode ) ;
You can’t perform that action at this time.
0 commit comments