public void Dispose() { disposed = true; CloseTimerCursor(); if (!hasMoved) { if (!timerFired) { ShowClickCursor(); ContactActionHelper.LeftTap(Location); } else if (timerFiredCount == 1) { ContactActionHelper.RightTap(Location); } else if (timerFiredCount == 2) { ShowClickCursor(); ContactActionHelper.LeftUp(Location); } } else { if (timerFired) { ContactActionHelper.RightUp(Location); } else { ContactActionHelper.LeftUp(Location); } } }
public void Move(ContactInfo info) { if (disposed) { throw new ObjectDisposedException("Contact is already up"); } double distance = (info.Rectangle.Location - Location).Length; if (distance > 1) { CloseTimerCursor(); if (!hasMoved) { if (timerFired) { ContactActionHelper.RightDown(Location); } else { ContactActionHelper.LeftDown(Location); } } hasMoved = true; Location = info.Rectangle.Location; ContactActionHelper.Drag(Location); } }
private void timer_Elapsed(object sender, ElapsedEventArgs e) { if (!hasMoved && !disposed) { timerFired = true; timerFiredCount++; if (timerFiredCount < 2) { timer.Start(); } else if (timerFiredCount == 2) { CloseTimerCursor(); ContactActionHelper.LeftDown(Location); } } }