public void SetUp() { _parentCtrl = new StubControl(); _parentCtrl.Bounds = new Rectangle(0, 0, 200, 200); _ctrl = new NuGenWndLessControl(); _ctrl.Bounds = new Rectangle(20, 20, 50, 50); _ctrl.Parent = _parentCtrl; _eventSink = new EventSink(_ctrl); _goodMouseEventArgs = new MouseEventArgs(MouseButtons.Left, 1, 30, 30, 0); _goodMouseEventArgs2 = new MouseEventArgs(MouseButtons.Left, 1, 50, 50, 0); _badMouseEventArgs = new MouseEventArgs(MouseButtons.Left, 1, 0, 0, 0); }
public EventSink(NuGenWndLessControl eventBubbler) { Assert.IsNotNull(eventBubbler); eventBubbler.Click += delegate { _clickCount.Inc(); }; eventBubbler.MouseDown += delegate { _mouseDownCount.Inc(); }; eventBubbler.MouseEnter += delegate { _mouseEnterCount.Inc(); }; eventBubbler.MouseLeave += delegate { _mouseLeaveCount.Inc(); }; eventBubbler.MouseMove += delegate { _mouseMoveCount.Inc(); }; eventBubbler.MouseUp += delegate { _mouseUpCount.Inc(); }; eventBubbler.Paint += delegate { _paintCount.Inc(); }; eventBubbler.ParentChanged += delegate { _parentChangedCount.Inc(); }; }