public DynamicListMouseEventArgs(DynamicList list, MouseEventArgs me) : base(me.Button, me.Clicks, me.X, me.Y, me.Delta) { if (list == null) { throw new ArgumentNullException("list"); } this.list = list; }
public ItemPaintEventArgs(Graphics graphics, Rectangle rectangle, Rectangle fillRectangle, DynamicList list, DynamicListColumn column, DynamicListItem item, bool isMouseEntered) : base(graphics, rectangle) { this.fillRectangle = fillRectangle; this.list = list; this.column = column; this.item = item; this.isMouseEntered = isMouseEntered; }
internal void NotifyListVisibilityChange(DynamicList list, bool visible) { if (visible) { this.OnShown(new DynamicListEventArgs(list)); } else { this.OnHidden(new DynamicListEventArgs(list)); } }
private void HandleLabelEditClick(DynamicList list) { if (this.allowLabelEdit) { TextBox txt = new TextBox(); txt.Text = this.Text; this.AssignControlUntilFocusChange(txt); if (this.BeginLabelEdit != null) { this.BeginLabelEdit(this, new DynamicListEventArgs(list)); } bool escape = false; txt.KeyDown += delegate (object sender2, KeyEventArgs e2) { if ((e2.KeyData == Keys.Return) || (e2.KeyData == Keys.Escape)) { e2.Handled = true; if (e2.KeyData == Keys.Escape) { if (this.CanceledLabelEdit != null) { this.CanceledLabelEdit(this, new DynamicListEventArgs(list)); } escape = true; } this.Control = null; txt.Dispose(); } }; txt.LostFocus += delegate { if (!escape) { this.Text = txt.Text; if (this.FinishLabelEdit != null) { this.FinishLabelEdit(this, new DynamicListEventArgs(list)); } } }; } }
internal void PaintTo(Graphics g, Rectangle rectangle, DynamicList list, DynamicListColumn column, bool isMouseEntered) { Rectangle rect = rectangle; rect.Width++; if ((this.highlightBrush != null) && isMouseEntered) { g.FillRectangle(this.highlightBrush, rect); } else { bool isActivated = list.IsActivated; Brush rowHighlightBrush = this.GetBrush(isActivated, this.backgroundBrush, this.backgroundBrushInactive); if (rowHighlightBrush == null) { rowHighlightBrush = this.GetBrush(isActivated, column.BackgroundBrush, column.BackgroundBrushInactive); if ((isActivated && (list.RowAtMousePosition == this.row)) && (column.RowHighlightBrush != null)) { rowHighlightBrush = column.RowHighlightBrush; } } g.FillRectangle(rowHighlightBrush, rect); } if (this.Paint != null) { this.Paint(this, new ItemPaintEventArgs(g, rectangle, rect, list, column, this, isMouseEntered)); } if (this.text.Length > 0) { g.DrawString(this.text, this.font, this.textBrush, rectangle, this.textFormat); } }
internal void OnMouseLeave(DynamicList list) { if (this.MouseLeave != null) { this.MouseLeave(this, new DynamicListEventArgs(list)); } if (this.highlightBrush != null) { this.RaiseItemChanged(); } }
internal void OnMouseHover(DynamicList list) { if (this.MouseHover != null) { this.MouseHover(this, new DynamicListEventArgs(list)); } }
public void PerformDoubleClick(DynamicList list) { if (this.DoubleClick != null) { this.DoubleClick(this, new DynamicListEventArgs(list)); } }
public void PerformClick(DynamicList list) { if (this.Click != null) { this.Click(this, new DynamicListEventArgs(list)); } this.HandleLabelEditClick(list); }
protected virtual void OnPlusClick(object sender, DynamicListEventArgs e) { if (this.blockClickEvent) { this.blockClickEvent = false; } else { int num5; this.OnExpanding(e); ChildForm frm = new ChildForm(); frm.Closed += delegate { this.blockClickEvent = true; if (this.expandedIn != null) { this.expandedIn.Remove(e.List); } this.OnCollapsed(e); this.plus.RaiseItemChanged(); Timer timer = new Timer { Interval = 0x55 }; timer.Tick += delegate (object sender2, EventArgs e2) { ((Timer) sender2).Stop(); ((Timer) sender2).Dispose(); this.blockClickEvent = false; }; timer.Start(); }; Point point = e.List.PointToScreen(e.List.GetPositionFromRow(this)); point.Offset(e.List.Columns[0].Width, base.Height); frm.StartPosition = FormStartPosition.Manual; frm.BackColor = this.childBorderColor; frm.Location = point; frm.ShowInTaskbar = false; frm.Owner = e.List.FindForm(); VerticalScrollContainer container = new VerticalScrollContainer(); container.Dock = DockStyle.Fill; DynamicList list = new DynamicList(this.childColumns, this.childRows); list.Dock = DockStyle.Fill; list.KeyDown += delegate (object sender2, KeyEventArgs e2) { if (e2.KeyData == Keys.Escape) { frm.Close(); e.List.FindForm().Focus(); } }; container.Controls.Add(list); frm.Controls.Add(container); int num = Screen.FromPoint(point).WorkingArea.Bottom - point.Y; num -= frm.Size.Height - frm.ClientSize.Height; int num2 = list.TotalRowHeight + 4; int height = Math.Min(num2, num); if (height < num2) { int num4 = Math.Min(100, num2 - height); height += num4; frm.Top -= num4; } using (Graphics graphics = list.CreateGraphics()) { num5 = 8 + list.GetRequiredWidth(graphics); } int num6 = Screen.FromPoint(point).WorkingArea.Right - point.X; if (num5 > num6) { int num7 = Math.Min(100, num5 - num6); num5 = num6 + num7; frm.Left -= num7; } frm.ClientSize = new Size(num5, height); frm.MinimumSize = new Size(100, Math.Min(50, height)); isOpeningChild = true; frm.Show(); isOpeningChild = false; list.Focus(); if (this.expandedIn != null) { this.expandedIn.Add(e.List); } this.OnExpanded(e); this.plus.RaiseItemChanged(); } }