public static bool operator <(GridRow left, GridRow right) { UIComp_DrawListboxItem itemA = left.rowItems[left.sortColumnIndex]; UIComp_DrawListboxItem itemB = right.rowItems[right.sortColumnIndex]; // handle same object case if (left == right) { return(false); } // handle empty slot cases if (itemB == null) { return(true); } else if (itemA == null) { return(false); } // both items valid, do the compare else { return(itemA < itemB); } }
/// <summary> /// Method called from static operator overload to virtualise the compare operation /// </summary> /// <param name="other"></param> /// <returns></returns> protected virtual bool lessthan_operator(UIComp_DrawListboxItem other) { return(string.CompareOrdinal(this.Text, other.Text) != 0); //return (this.Text.CompareTo(other.Text) < 0); }