Пример #1
0
        protected virtual void EnsureColumnVisibleCore(ListViewDetailColumn column)
        {
            bool start  = false;
            int  offset = 0;
            ListViewDetailColumn lastVisible =
                ((DetailListViewHeaderCellElement)this.columnContainer.Children[this.columnContainer.Children.Count - 1]).Data;
            ItemsTraverser <ListViewDetailColumn> traverser =
                (ItemsTraverser <ListViewDetailColumn>) this.ColumnScroller.Traverser.GetEnumerator();
            DetailListViewHeaderCellElement cell = null;

            while (traverser.MoveNext())
            {
                if (traverser.Current == column)
                {
                    this.SetScrollValue(this.ColumnScrollBar, this.ColumnScrollBar.Value + offset);
                    this.UpdateLayout();
                    cell = this.GetHeaderCell(column);

                    if (cell != null &&
                        cell.ControlBoundingRectangle.Right > this.columnContainer.ControlBoundingRectangle.Right)
                    {
                        this.EnsureColumnVisible(column);
                    }
                    break;
                }
                if (traverser.Current == lastVisible)
                {
                    start = true;
                }
                if (start)
                {
                    offset += (int)columnContainer.ElementProvider.GetElementSize(traverser.Current).Width + columnContainer.ItemSpacing;
                }
            }
        }
Пример #2
0
        protected virtual void EnsureColumnVisibleCore(ListViewDetailColumn column)
        {
            bool flag1 = false;
            int  num   = 0;
            ListViewDetailColumn data = ((DetailListViewCellElement)this.columnContainer.Children[this.columnContainer.Children.Count - 1]).Data;
            ItemsTraverser <ListViewDetailColumn> enumerator = (ItemsTraverser <ListViewDetailColumn>) this.ColumnScroller.Traverser.GetEnumerator();

            while (enumerator.MoveNext())
            {
                if (enumerator.Current == column)
                {
                    this.SetScrollValue(this.ColumnScrollBar, this.ColumnScrollBar.Value + num);
                    this.UpdateLayout();
                    DetailListViewHeaderCellElement headerCell = this.GetHeaderCell(column);
                    bool flag2 = headerCell != null && headerCell.ControlBoundingRectangle.Right > this.columnContainer.ControlBoundingRectangle.Right;
                    bool flag3 = headerCell != null && headerCell.ControlBoundingRectangle.Left < this.columnContainer.ControlBoundingRectangle.Left && this.RightToLeft;
                    if (!flag2 && !flag3)
                    {
                        break;
                    }
                    this.EnsureColumnVisible(column);
                    break;
                }
                if (enumerator.Current == data)
                {
                    flag1 = true;
                }
                if (flag1)
                {
                    num += (int)this.columnContainer.ElementProvider.GetElementSize(enumerator.Current).Width + this.columnContainer.ItemSpacing;
                }
            }
        }
Пример #3
0
 public virtual IEnumerator GetEnumerator()
 {
     if (this.enumerator == null)
     {
         this.enumerator = new ItemsTraverser <T>(this.collection);
         this.enumerator.ItemsNavigating += new ItemsNavigatingEventHandler <T>(this.Enumerator_ItemsNavigating);
     }
     this.enumerator.Position = (object)this.position;
     return((IEnumerator)this.enumerator);
 }
Пример #4
0
        public IEnumerator GetEnumerator()
        {
            if (enumerator == null)
            {
                this.enumerator = new ItemsTraverser <T>(this.collection);
                this.enumerator.ItemsNavigating += new ItemsNavigatingEventHandler <T>(Enumerator_ItemsNavigating);
            }

            this.enumerator.Position = this.position;
            return(enumerator);
        }