private void SortByHeaderCell( DetailListViewHeaderCellElement headerCellUnderMouse, Point location) { ListViewDetailColumn data = headerCellUnderMouse.Data; if (!data.Owner.EnableSorting || !data.Owner.EnableColumnSort || (headerCellUnderMouse.IsInResizeLocation(location) || data.Owner.ColumnResizingBehavior.IsResizing)) { return; } int index = data.Owner.SortDescriptors.IndexOf(data.Name); ListSortDirection direction = ListSortDirection.Ascending; bool flag = true; if (index >= 0) { direction = data.Owner.SortDescriptors[index].Direction; if (direction == ListSortDirection.Ascending) { direction = ListSortDirection.Descending; } else { flag = false; } } data.Owner.SortDescriptors.BeginUpdate(); data.Owner.SortDescriptors.Clear(); if (flag) { data.Owner.SortDescriptors.Add(data.Name, direction); } data.Owner.SortDescriptors.EndUpdate(); headerCellUnderMouse.Synchronize(); }
protected internal override bool ProcessMouseMove(MouseEventArgs e) { bool flag = base.ProcessMouseMove(e); this.Owner.ColumnResizingBehavior.HandleMouseMove(e.Location); DetailListViewHeaderCellElement elementAtPoint = this.ElementTree.GetElementAtPoint(e.Location) as DetailListViewHeaderCellElement; if (this.Owner.ColumnResizingBehavior.IsResizing) { return(flag); } if (elementAtPoint != null && elementAtPoint.IsInResizeLocation(e.Location)) { if (this.originalMouseCursor == (Cursor)null) { this.originalMouseCursor = this.ElementTree.Control.Cursor; } this.ElementTree.Control.Cursor = Cursors.SizeWE; } else if (this.originalMouseCursor != (Cursor)null) { this.ElementTree.Control.Cursor = this.originalMouseCursor; this.originalMouseCursor = (Cursor)null; } return(flag); }
internal override bool ProcessMouseMove(MouseEventArgs e) { bool result = base.ProcessMouseMove(e); this.owner.ColumnResizingBehavior.HandleMouseMove(e.Location); DetailListViewHeaderCellElement headerCell = this.ElementTree.GetElementAtPoint(e.Location) as DetailListViewHeaderCellElement; if (this.owner.ColumnResizingBehavior.IsResizing) { return(result); } if (headerCell != null && headerCell.IsInResizeLocation(e.Location)) { this.ElementTree.Control.Cursor = Cursors.SizeWE; } else { this.ElementTree.Control.Cursor = Cursors.Default; } return(result); }