public int CompareTo(Wrapper wrapper) { int result = -UIUtils.IsCustomFiltered(mType).CompareTo(UIUtils.IsCustomFiltered(wrapper.mType)); if (result != 0) { return(result); } result = UIUtils.IsInstalledContent(mType).CompareTo(UIUtils.IsInstalledContent(wrapper.mType)); if (result != 0) { return(result); } ProductVersion left = UIUtils.ExtractProductVersion(mType); ProductVersion right = UIUtils.ExtractProductVersion(wrapper.mType); result = -left.CompareTo(right); if (result != 0) { return(result); } return(mPart.DisplayIndex.CompareTo(wrapper.mPart.DisplayIndex)); }