nature_net.configurations.IsFirstItemGreaterThanSecond C# (CSharp) Метод

IsFirstItemGreaterThanSecond() публичный статический Метод

public static IsFirstItemGreaterThanSecond ( nature_net first, nature_net second, bool atoz, bool top, bool recent, int len_number_prefix, int len_date_prefix, bool asc ) : bool
first nature_net
second nature_net
atoz bool
top bool
recent bool
len_number_prefix int
len_date_prefix int
asc bool
Результат bool
        public static bool IsFirstItemGreaterThanSecond(nature_net.user_controls.item_generic_v2 first, nature_net.user_controls.item_generic_v2 second, bool atoz, bool top, bool recent, int len_number_prefix, int len_date_prefix, bool asc)
        {
            if (atoz)
                if (first.title.Text.CompareTo(second.title.Text) > 0) return !asc;
                else return asc;
            if (top)
            {
                if (GetNumberFromItemGeneric(first) > GetNumberFromItemGeneric(second)) return asc;
                else return !asc;
            }
            if (recent)
            {
                if (!GetDate_FromFormatted(first.user_info_date.Text.ToString()).HasValue) return !asc;
                if (!GetDate_FromFormatted(second.user_info_date.Text.ToString()).HasValue) return asc;
                if (GetDate_FromFormatted(first.user_info_date.Text.ToString()).Value.CompareTo(GetDate_FromFormatted(second.user_info_date.Text.ToString()).Value) > 0)
                    return asc;
                else
                    return !asc;
            }
            return false;
        }