示例#1
0
        /// <summary>
        /// Sorts an array of <see cref="SccStamp"/> objects by their
        /// revision numbers in ascending or descending order.
        /// </summary>

        public static void SortByRevision(SccStamp[] stamps, bool descending)
        {
            IComparer comparer = new RevisionComparer();

            if (descending)
            {
                comparer = new ReverseComparer(comparer);
            }

            Array.Sort(stamps, comparer);
        }
示例#2
0
        /// <summary>
        /// Sorts an array of <see cref="SccStamp"/> objects by their
        /// revision numbers in ascending or descending order.
        /// </summary>

        public static void SortByLastChanged(SccStamp[] stamps, bool descending)
        {
            IComparer comparer = new LastChangedComparer();

            if (descending)
            {
                comparer = new ReverseComparer(comparer);
            }

            Array.Sort(stamps, comparer);
        }