Пример #1
0
        IEnumerable <string[]> GetSortedHistoryData()
        {
            const int MiB      = 1024 * 1024;
            var       contents = settings.GetAllStatsData()
                                 .Select(d =>
            {
                var v = d.Value;
                return(new string[] {
                    v.title,
                    v.curDownSpeed.ToString(),
                    v.curUpSpeed.ToString(),
                    (v.totalDown / MiB).ToString(),
                    (v.totalUp / MiB).ToString(),
                });
            });

            var index = dataViewOrderKeyIndex;

            if (index == 0)
            {
                return(contents);
            }

            return(sortFlags[index] ?
                   contents.OrderBy(e => VgcApis.Misc.Utils.Str2Int(e[index])) :
                   contents.OrderByDescending(e => VgcApis.Misc.Utils.Str2Int(e[index])));
        }