예제 #1
0
        public static int CompareByString(ListViewItem lvi1, ListViewItem lvi2, IExRepListViewColumnValuePresenter presenter, SortOrder sortOrder)
        {
            if (Configuration.SortDirectoriesOnTop && ((lvi1.Tag is DirectoryInfo && lvi2.Tag is FileInfo) || (lvi1.Tag is FileInfo && lvi2.Tag is DirectoryInfo)))
                return -1;

            string value1 = presenter.GetPresentation((FileSystemInfo)lvi1.Tag);
            string value2 = presenter.GetPresentation((FileSystemInfo)lvi2.Tag);

            return GetCompareValueByString(sortOrder, value1, value2);
        }
예제 #2
0
        public static int CompareByString(ListViewItem lvi1, ListViewItem lvi2, IExRepListViewColumnValuePresenter presenter, SortOrder sortOrder)
        {
            if (Configuration.SortDirectoriesOnTop && ((lvi1.Tag is DirectoryInfo && lvi2.Tag is FileInfo) || (lvi1.Tag is FileInfo && lvi2.Tag is DirectoryInfo)))
            {
                return(-1);
            }

            string value1 = presenter.GetPresentation((FileSystemInfo)lvi1.Tag);
            string value2 = presenter.GetPresentation((FileSystemInfo)lvi2.Tag);

            return(GetCompareValueByString(sortOrder, value1, value2));
        }
예제 #3
0
        public static int CompareByLong(ListViewItem lvi1, ListViewItem lvi2, IExRepListViewColumnValuePresenter presenter, SortOrder sortOrder)
        {
            if (Configuration.SortDirectoriesOnTop && ((lvi1.Tag is DirectoryInfo && lvi2.Tag is FileInfo) || (lvi1.Tag is FileInfo && lvi2.Tag is DirectoryInfo)))
                return -1;

            long value1;
            if(!long.TryParse(presenter.GetPresentation((FileSystemInfo)lvi1.Tag), out value1))
                value1 = 0;

            long value2;
            if(!long.TryParse(presenter.GetPresentation((FileSystemInfo)lvi2.Tag), out value2))
                value2 = 0;

            return GetCompareValueByLong(sortOrder, value1, value2);
        }
예제 #4
0
        public static int CompareByLong(ListViewItem lvi1, ListViewItem lvi2, IExRepListViewColumnValuePresenter presenter, SortOrder sortOrder)
        {
            if (Configuration.SortDirectoriesOnTop && ((lvi1.Tag is DirectoryInfo && lvi2.Tag is FileInfo) || (lvi1.Tag is FileInfo && lvi2.Tag is DirectoryInfo)))
            {
                return(-1);
            }

            long value1;

            if (!long.TryParse(presenter.GetPresentation((FileSystemInfo)lvi1.Tag), out value1))
            {
                value1 = 0;
            }

            long value2;

            if (!long.TryParse(presenter.GetPresentation((FileSystemInfo)lvi2.Tag), out value2))
            {
                value2 = 0;
            }

            return(GetCompareValueByLong(sortOrder, value1, value2));
        }