Example #1
0
        public List <HeaderData> GenerateHeaderList(IStickyGridHeadersSimpleAdapter adapter)
        {
            Dictionary <long, HeaderData> mapping = new Dictionary <long, HeaderData>();
            List <HeaderData>             headers = new List <HeaderData>();

            for (int i = 0; i < adapter.Count; i++)
            {
                long       headerId = adapter.GetHeaderId(i);
                HeaderData headerData;
                if (!mapping.TryGetValue(headerId, out headerData))
                {
                    headerData = new HeaderData(this, i);
                    headers.Add(headerData);
                }
                headerData.IncrementCount();
                mapping[headerId] = headerData;
            }

            return(headers);
        }