private static Row[] GetRowsInGuiOrder(this RowSelectionList rowSelectionList)
        {
            if (rowSelectionList == null || rowSelectionList.Count == 0)
            {
                return(new Row[0]);
            }

            return(rowSelectionList.GetRows().GetRowsInGuiOrder());
        }
        /// <summary>
        /// Gets a unique subset of the rows from <paramref name="rowSelectionList"/>, so that
        /// no row is a descendant of any other row.
        /// The rows are sorted in the order they appear in the tree.
        /// </summary>
        /// <param name="rowSelectionList">the rows</param>
        /// <returns>the unique rows in GUI order</returns>
        internal static Row[] GetUniqueRowsInGuiOrder(this RowSelectionList rowSelectionList)
        {
            if (rowSelectionList == null || rowSelectionList.Count == 0)
            {
                return new Row[] { }
            }
            ;

            return(rowSelectionList.GetRows().GetUniqueRowsInGuiOrder());
        }