protected void DisposeInternal() { m_Canvas.MouseDown -= MouseDown; m_Canvas.MouseMove -= MouseMove; m_Canvas.MouseUp -= MouseUp; m_Canvas.MouseLeave -= MouseLeave; m_Canvas.MouseClick -= MouseClick; m_Canvas.Click -= Click; m_Canvas.DoubleClick -= DoubleClick; m_Canvas.Paint -= Paint; Form frm = m_Canvas.FindForm(); if (frm != null) { frm.KeyPress -= KeyPress; } Execute -= this.ExecuteEvent; }
public BaseTool(CanvasControl canvas) { m_Canvas = canvas; m_Canvas.MouseDown += MouseDown; m_Canvas.MouseMove += MouseMove; m_Canvas.MouseUp += MouseUp; m_Canvas.MouseLeave += MouseLeave; m_Canvas.MouseClick += MouseClick; m_Canvas.Click += Click; m_Canvas.DoubleClick += DoubleClick; m_Canvas.Paint += Paint; Form frm = m_Canvas.FindForm(); if (frm != null) { frm.KeyPress += KeyPress; } Execute += this.ExecuteEvent; }