Exemplo n.º 1
0
 private void Timer_Tick(object sender, EventArgs e)
 {
     if (immortal != null)
     {
         immortal.HandleUserInputExternal(_mousePosInternal.X, _mousePosInternal.Y, _mouseDownInternal);
     }
     Refresh();
 }
Exemplo n.º 2
0
        private void Timer_Tick(object sender, object e)
        {
            if (immortal == null)
            {
                return;
            }

            if (immortal.DoneRecovering())
            {
                immortal.HandleUserInputExternal((int)pointerPosInternal.X, (int)pointerPosInternal.Y, pointerDownInternal);
            }

            canvas.Children.Clear();

            List <System.Drawing.Point> myPoints;
            List <System.Drawing.Point> otherPoints;

            immortal.GetAppStateExternal(out myPoints, out otherPoints);

            for (int i = 0; i < myPoints.Count() - 1; i++)
            {
                Line line = new Line();
                line.X1     = myPoints[i].X;
                line.Y1     = myPoints[i].Y;
                line.X2     = myPoints[i + 1].X;
                line.Y2     = myPoints[i + 1].Y;
                line.Stroke = new SolidColorBrush(Windows.UI.Colors.Black);
                canvas.Children.Add(line);
            }

            for (int i = 0; i < otherPoints.Count() - 1; i++)
            {
                Line line = new Line();
                line.X1     = otherPoints[i].X;
                line.Y1     = otherPoints[i].Y;
                line.X2     = otherPoints[i + 1].X;
                line.Y2     = otherPoints[i + 1].Y;
                line.Stroke = new SolidColorBrush(Windows.UI.Colors.Red);
                canvas.Children.Add(line);
            }
        }