public override AccessibleObject GetChild(int index) { ListViewTraverser enumerator = this.ListView.ListViewElement.ViewElement.Scroller.Traverser.GetEnumerator() as ListViewTraverser; enumerator.Reset(); int num = -1; if (this.ListView.ViewType == ListViewType.DetailsView && this.ListView.ShowColumnHeaders) { if (index == 0) { return((AccessibleObject) new ListViewHeaderRowAccessibleObject((this.listView.ListViewElement.ViewElement as DetailListViewElement).ColumnContainer, this.ListView.ListViewElement)); } num = 0; } while (enumerator.MoveNext()) { ++num; if (num == index) { if (enumerator.Current is ListViewDataItemGroup) { return((AccessibleObject) new ListViewDataGroupAccessibleObject(enumerator.Current as ListViewDataItemGroup)); } if (this.ListView.ViewType == ListViewType.DetailsView) { return((AccessibleObject) new ListViewRowAccessibleObject(enumerator.Current)); } return((AccessibleObject) new ListViewDataItemAccessibleObject(enumerator.Current)); } } return((AccessibleObject)null); }
protected override void ProcessLassoSelection(Rectangle selectionRect) { if (!this.Owner.MultiSelect) { base.ProcessLassoSelection(selectionRect); } else { ListViewTraverser enumerator = this.Scroller.Traverser.GetEnumerator() as ListViewTraverser; int headerHeight = (int)this.Owner.HeaderHeight; enumerator.Reset(); while (enumerator.MoveNext()) { if (enumerator.Current.Owner == this.Owner) { Rectangle rectangle = new Rectangle(new Point(!this.Owner.ShowGroups || this.Owner.Groups.Count <= 0 || !this.Owner.EnableCustomGrouping && !this.Owner.EnableGrouping ? 0 : this.GroupIndent, headerHeight), enumerator.Current.ActualSize); if (this.RightToLeft) { rectangle = LayoutUtils.RTLTranslateNonRelative(rectangle, this.ViewElement.ControlBoundingRectangle); } this.ProcessItemLassoSelection(enumerator.Current, selectionRect.IntersectsWith(rectangle)); headerHeight += enumerator.Current.ActualSize.Height + this.ItemSpacing; } } } }
private int GetGroupsHeight() { int val1 = 0; ListViewTraverser enumerator = this.Traverser.GetEnumerator() as ListViewTraverser; enumerator.Reset(); while (enumerator.MoveNext()) { if (enumerator.Current is ListViewDataItemGroup) { val1 = Math.Max(val1, enumerator.Current.ActualSize.Height); } } return(val1); }
public override int GetChildCount() { if (this.ListView.IsDisposed) { return(0); } ListViewTraverser enumerator = this.ListView.ListViewElement.ViewElement.Scroller.Traverser.GetEnumerator() as ListViewTraverser; enumerator.Reset(); int num = 0; while (enumerator.MoveNext()) { ++num; } return(num); }
protected override void ProcessLassoSelection(Rectangle selectionRect) { if (!this.Owner.MultiSelect) { base.ProcessLassoSelection(selectionRect); } else { Rectangle rectangle1 = new Rectangle(this.ViewElement.Padding.Left, this.ViewElement.Padding.Top, this.ViewElement.Size.Width - this.ViewElement.Padding.Horizontal, this.ViewElement.Size.Height - this.ViewElement.Padding.Vertical); if (this.RightToLeft) { rectangle1 = LayoutUtils.RTLTranslateNonRelative(rectangle1, this.ControlBoundingRectangle); } selectionRect.Offset(-rectangle1.Location.X, -rectangle1.Location.Y); ListViewTraverser enumerator = this.Scroller.Traverser.GetEnumerator() as ListViewTraverser; int x1 = rectangle1.X; int y = rectangle1.Y; enumerator.Reset(); int val1_1 = 0; int val1_2 = 0; while (enumerator.MoveNext()) { if (enumerator.Current.Owner == this.Owner) { Size actualSize = enumerator.Current.ActualSize; val1_1 = Math.Max(val1_1, actualSize.Height); val1_2 = Math.Max(val1_2, actualSize.Width); if (enumerator.Current is ListViewDataItemGroup) { if (x1 != rectangle1.X) { int x2 = rectangle1.X; y += val1_1; val1_1 = actualSize.Height; } x1 = rectangle1.X; y += actualSize.Height + this.ItemSpacing; } else { if (x1 + actualSize.Width > rectangle1.Right && this.Orientation == Orientation.Vertical) { x1 = rectangle1.X; y += val1_1 + this.ItemSpacing; val1_1 = actualSize.Height; } else if (y + actualSize.Height > rectangle1.Bottom && this.Orientation == Orientation.Horizontal) { y = rectangle1.Y; x1 += val1_2 + this.ItemSpacing; val1_2 = actualSize.Width; } if (x1 == rectangle1.X && this.Owner.ShowGroups && (this.Owner.EnableCustomGrouping || this.Owner.EnableGrouping) && (this.Owner.Groups.Count > 0 && !this.Owner.FullRowSelect)) { x1 += this.Owner.GroupIndent; } Rectangle rectangle2 = new Rectangle(new Point(x1, y), actualSize); if (this.RightToLeft) { rectangle2 = LayoutUtils.RTLTranslateNonRelative(rectangle2, rectangle1); } this.ProcessItemLassoSelection(enumerator.Current, selectionRect.IntersectsWith(rectangle2)); if (this.Orientation == Orientation.Vertical) { x1 += actualSize.Width + this.ItemSpacing; } else { y += actualSize.Height + this.ItemSpacing; } } } } } }