public IMovingTrajectory GetMovingTrajectory() { IMovingTrajectory movingTrajectory = null; switch (MovingType) { case MovingType.Circle: movingTrajectory = new MovingCircle(Center, Radius, CirclePeriod, CircleAngle); break; case MovingType.Linear: movingTrajectory = new MovingLine(FirstPosition, SecondPosition, LinearPeriod, LinearTime); break; case MovingType.Static: movingTrajectory = new MovingStatic(Position); break; } return(movingTrajectory); }
private void SetCanvasEvents() { editorCanvas.MouseRightButtonUp += (s, e) => { _canvasLastRightTappedPoint = e.GetPosition(editorCanvas); }; editorCanvas.ToFrameworkElement().MouseLeftButtonUp += (s, e) => { ConnectionCreateCleanup(); }; editorCanvas.ToFrameworkElement().MouseMove += (s, e) => { if (MovingLine == null) { return; } MovingLine.DrawPath(MovingLine.Start.Point, e.GetPosition(editorCanvas).ToWorkFlowPoint()); }; }
private void SetCanvasEvents() { editorCanvas.IsRightTapEnabled = true; editorCanvas.RightTapped += (s, e) => { _canvasLastRightTappedPoint = e.GetPosition(editorCanvas); }; editorCanvas.PointerReleased += (s, e) => { ConnectionCreateCleanup(); }; editorCanvas.PointerMoved += (s, e) => { if (MovingLine == null) { return; } MovingLine.DrawPath(MovingLine.Start.Point, e.GetCurrentPoint(editorCanvas).Position.CreateWorkFlowPoint()); }; }