public int CompareTo(object obj) { int ret = 0; try { clsStatItem si = (clsStatItem)obj; ret = (Goals + Assists).CompareTo(si.Goals + si.Assists); if (ret == 0) { ret = Goals.CompareTo(si.Goals); } if (ret == 0) { ret = -PenaltyMin.CompareTo(si.PenaltyMin); } } catch (Exception ex) { clsError.SendError(ex); } return(ret); }