예제 #1
0
            protected override void OnPaint(PaintEventArgs e)
            {
                if (VirtualListSize == 0)
                {
                    return;
                }
                int itemWidth  = GetItemWidth();
                int itemHeight = GetItemHeight();
                int pagesize   = (ClientSize.Height % itemHeight) == 0 ?
                                 (ClientSize.Height / itemHeight) : (ClientSize.Height / itemHeight) + 1;
                int startIndex = GetTopIndex();
                int endIndex   = Math.Min(startIndex + pagesize, VirtualListSize);

                Rectangle bound = new Rectangle(0, 0, itemWidth, itemHeight);

                for (int index = startIndex; index < endIndex; index++)
                {
                    var re = new RetrieveCommandListItemEventArgs(index);
                    OnRetrieveCommandListItem(re);
                    re.Item.SetIndex(index);
                    re.Item.SetBounds(bound);
                    var de = new DrawCommandListItemEventArgs(e.Graphics, re.Item);
                    OnDrawItem(de);
                    bound.Y += itemHeight;
                }
            }
예제 #2
0
 private void OnDrawItem(DrawCommandListItemEventArgs e)
 {
     DrawItem.Raise(this, e);
 }
예제 #3
0
 private void OnDrawItem(DrawCommandListItemEventArgs e)
 {                
     DrawItem.Raise(this, e);
 }
예제 #4
0
            protected override void OnPaint(PaintEventArgs e)
            {                
                if (VirtualListSize == 0) return;
                int itemWidth = GetItemWidth();
                int itemHeight = GetItemHeight();
                int pagesize = (ClientSize.Height % itemHeight) == 0 ?
                    (ClientSize.Height / itemHeight) : (ClientSize.Height / itemHeight) + 1;
                int startIndex = GetTopIndex();
                int endIndex = Math.Min(startIndex+pagesize, VirtualListSize);

                Rectangle bound = new Rectangle(0, 0, itemWidth, itemHeight);

                for (int index = startIndex; index < endIndex; index++)
                {
                    var re = new RetrieveCommandListItemEventArgs(index);
                    OnRetrieveCommandListItem(re);
                    re.Item.SetIndex(index);
                    re.Item.SetBounds(bound);
                    var de = new DrawCommandListItemEventArgs(e.Graphics,re.Item);
                    OnDrawItem(de);
                    bound.Y +=itemHeight;
                }
            }