Beispiel #1
0
 public Template(String name, String appPath = null, bool init = false)
 {
     Name    = name ?? DEFAULT_TEMPLATE_NAME;
     AppPath = appPath;
     if (init)
     {
         Clicks.Add(new Click());
     }
 }
Beispiel #2
0
 public void Merge(MouseActData additionLog)
 {
     LastPoint = additionLog.LastPoint;
     Delta    += additionLog.Delta;
     Path     += additionLog.Path;
     foreach (MouseButtons mb in additionLog.Clicks.Keys)
     {
         if (!Clicks.ContainsKey(mb))
         {
             Clicks.Add(mb, 0);
         }
         Clicks[mb] += additionLog.Clicks[mb];
     }
 }
        public void Click(Point point)
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Start();
            Clicks.Add(point);
            switch (_formAction)
            {
            case FormAction.SetPixel:
                CreatePoint();
                break;

            case FormAction.DrawLine:
                DrawLine();
                break;

            case FormAction.StartDrawPolygon:
                StartDrawingPolygon();
                break;

            case FormAction.SelectLine:
                SelectObject();
                break;

            case FormAction.DrawCircleOptimized:
                DrawCircle();
                break;

            case FormAction.RedrawBitmap:
                Redraw();
                break;

            case FormAction.MoveObject:
                MoveObject();
                break;

            case FormAction.MoveVerticle:
                MoveVerticle();
                break;

            case FormAction.SetConcrentic:
                SetConcrentic();
                break;
            }
            stopWatch.Stop();
            _timeTextBox.Text = stopWatch.Elapsed.TotalSeconds.ToString();
        }
Beispiel #4
0
 /// <summary>
 ///     Adds a click to the KPS times.
 /// </summary>
 public void AddClick() => Clicks.Add(Time);
 /// <summary>
 ///     Adds a click to the KPS times.
 /// </summary>
 public void AddClick()
 {
     Clicks.Add(Time);
     Value = Kps.ToString();
 }
Beispiel #6
0
        /// <summary>
        /// get all the current tap gestures
        /// </summary>
        private void GetGestures()
        {
            //go through the taps and get all the new ones
            while (TouchPanel.IsGestureAvailable)
            {
                GestureSample gesture = TouchPanel.ReadGesture();
                switch (gesture.GestureType)
                {
                case GestureType.Tap:
                {
                    var position = ConvertCoordinate(gesture.Position);
                    Clicks.Add(new ClickEventArgs()
                        {
                            Position = position,
                            Button   = MouseButton.Left
                        });
                }
                break;

                case GestureType.DoubleTap:
                {
                    var position = ConvertCoordinate(gesture.Position);
                    Clicks.Add(new ClickEventArgs()
                        {
                            Position    = position,
                            Button      = MouseButton.Left,
                            DoubleClick = true,
                        });
                }
                break;

                case GestureType.Flick:
                {
                    AddFlickEvent(gesture.Delta);
                }
                break;

                case GestureType.Pinch:
                {
                    var position1 = ConvertCoordinate(gesture.Position);
                    var position2 = ConvertCoordinate(gesture.Position2);

                    if (null == Pinch)
                    {
                        Pinch = new PinchManager(position1, position2);
                    }
                    else
                    {
                        Pinch.Update(position1, position2);
                    }
                }
                break;

                case GestureType.PinchComplete:
                {
                    Pinch = null;
                }
                break;
                }
            }
        }