Esempio n. 1
0
        /// <summary>
        /// Sorts strings (case-sensitive, descending)
        /// </summary>
        /// <returns>Returns the sorted strings</returns>
        public string[] SortDescending()
        {
            var str = new string[_values.Count];

            SortableString[] strings = SortableString.Sort((SortableString[])_values.ToArray(typeof(SortableString)));

            for (int i = str.Length - 1; i > -1; i--)
            {
                str[i] = strings[i].Value;
            }

            return(str);
        }
Esempio n. 2
0
        /// <summary>
        /// Sorts strings (case-sensitive, ascending)
        /// </summary>
        /// <returns>Returns the sorted strings</returns>
        public string[] Sort()
        {
            var str = new string[_values.Count];

            SortableString[] strings = SortableString.Sort((SortableString[])_values.ToArray(typeof(SortableString)));

            for (int i = 0; i < str.Length; i++)
            {
                str[i] = strings[i].Value;
            }

            return(str);
        }
Esempio n. 3
0
        /// <summary>
        /// Sorts strings (case-insensitive, descending)
        /// </summary>
        /// <returns>Returns the sorted strings</returns>
        public string[] InsensitiveSortDescending()
        {
            var str = new string[_values.Count];
            int i;

            var strings = (SortableString[])_values.ToArray(typeof(SortableString));

            for (i = 0; i < strings.Length; i++)
            {
                strings[i].Insensitive = true;
            }

            strings = SortableString.Sort(strings);

            for (i = str.Length - 1; i > -1; i--)
            {
                str[i] = strings[i].Value;
            }

            return(str);
        }