Beispiel #1
0
        private List <Tuple <int, int> > CreateSortedItemGroupList(string prevPath
                                                                   , List <Tuple <int, int> > prevSortGroupList0, List <int> orderdIdxData, gvCache cache)
        {
            var sortGroupList1 = new List <Tuple <int, int> >();

            if (prevSortGroupList0 == null)
            { // 最初
                sortGroupList1.Add(new Tuple <int, int>(0, cache.ItemsCount - 1));
            }
            else
            {
                IComparable[] values = cache.GetCache(prevPath);
                foreach (var kvp1 in prevSortGroupList0)
                {
                    IComparable prevVal1    = null;
                    int         startIndex1 = kvp1.Item1;
                    int         i_First1    = kvp1.Item1;
                    int         i_Last1     = kvp1.Item2;
                    for (int i1 = i_First1; i1 <= i_Last1; i1++)
                    {
                        IComparable val1 = values[orderdIdxData[i1]];
                        if (i1 != i_First1 && NullableEqualsTo(val1, prevVal1) == false)
                        {// 値が変化
                            sortGroupList1.Add(new Tuple <int, int>(startIndex1, i1 - 1));
                            startIndex1 = i1;
                        }
                        prevVal1 = val1;
                        if (i1 == i_Last1)
                        {// last
                            sortGroupList1.Add(new Tuple <int, int>(startIndex1, i1));
                        }
                    }
                }
            }
            return(sortGroupList1);
        }
Beispiel #2
0
 public ItemComparer(string sortBy0, ListSortDirection direction0, gvCache cache)
 {
     direction = direction0 == ListSortDirection.Descending ? -1 : 1;
     cache.GetCache(sortBy0, out this.values, out this.dvalues, out this.isnumeric, out this.keys);
 }