Still using old name some places, also removing .suo file from repo
[Widgit.git] / NodeSorter.cs
blob136e5d9e5f2f82830f64e6320584d830e1eb9950
1 using System;
2 using System.Collections;
3 using System.Text;
4 using System.Windows.Forms;
6 namespace Widgit
8 public class NodeSorter : IComparer
10 public int Compare(object x, object y)
12 TreeNode tx = x as TreeNode;
13 TreeNode ty = y as TreeNode;
15 // Compare the length of the strings, returning the difference.
16 if (tx.Nodes.Count > 0 && ty.Nodes.Count < 1)
17 return -1;
18 if (tx.Nodes.Count < 1 && ty.Nodes.Count > 0)
19 return 1;
21 return string.Compare(tx.Text, ty.Text);