private void B_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Middle) { Block.DisConnect(((OutButton)sender).Index); NeedInvalidate?.Invoke(); } }
private void btnIn_MouseMove(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return; } var s = (Control)sender; Left = Left + (e.X - ((Point)s.Tag).X); Top = Top + (e.Y - ((Point)s.Tag).Y); NeedInvalidate?.Invoke(); }
public Task InvalidateAndRenderAsync() { using (LockInternal()) { if (_invalidateAsync != null) { return(_invalidateAsync.Task); } if (NeedInvalidate != null) { NeedInvalidate?.Invoke(this, EventArgs.Empty); _invalidateAsync = _invalidateAsync ?? new TaskCompletionSource <bool>(); return(_invalidateAsync.Task); } return(Task.FromResult(false)); } }