示例#1
0
 static void LostMouseCapture(object sender, MouseEventArgs e)
 {
     if (device != null &&
         device.IsActive)
     {
         device.Position = e.GetPosition(null);
         device.ReportUp();
         device.Deactivate();
         device = null;
     }
 }
示例#2
0
 private static void MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (device != null &&
         device.IsActive)
     {
         device.ReportUp();
         device.Deactivate();
         device = null;
     }
     device = new MouseTouchDevice(e.MouseDevice.GetHashCode());
     device.SetActiveSource(e.MouseDevice.ActiveSource);
     device.Position = e.GetPosition(null);
     device.Activate();
     device.ReportDown();
 }