public int Compare(GUIListItem x, GUIListItem y) { int res = 0; if (x.Label == ".." && y.Label == "..") { res = 0; } else if (x.Label == "..") { res = -1; } else if (y.Label == "..") { res = 1; } else { BaseScore scx = x.TVTag as BaseScore; BaseScore scy = y.TVTag as BaseScore; if (scx == null || scy == null) { res = String.Compare(x.Label, y.Label); } else { res = scx.CompareTo(scy); } } return(res); }