public void MouseDown(Vector2 position) { MouseDownPosition = position; MouseClickDown(); if (IsPressed("d")) { DeleteAt?.Invoke(this, position); KeyPressed = null; } else if (IsPressed("c")) { CreateAt?.Invoke(this, position); } else if (IsPressed("p")) { AddPoint?.Invoke(this, position); } else { SelectAt?.Invoke(this, position); } LastMousePosition = position; }
static void Main(string[] args) { Console.WriteLine("Choose an option"); Console.WriteLine("{1}:Show list of customers"); Console.WriteLine("{2}:Register a new customer"); Console.WriteLine("{3}:Add a point towards a free haircut"); string userInput = Convert.ToString(Console.ReadLine()); if (userInput == "1") { Console.Clear(); ShowCustomers show = new ShowCustomers(); foreach (var person in show.ShowUsers()) { Console.WriteLine($"{person.FirstName} {person.LastName} {person.PhoneNumber} {person.RewardCount}"); } Console.ReadLine(); } else if (userInput == "2") { Console.Clear(); Register reg = new Register(); reg.RegisterUser(); } else if (userInput == "3") { Console.Clear(); AddPoint add = new AddPoint(); add.Points(); } }
private void OnPlusButtonClicked(AttributeRow row) { if (Input.GetKey(KeyCode.LeftShift)) { AddMultiplePoints?.Invoke(row.Attribute); } else { AddPoint?.Invoke(row.Attribute); } }
void Start() { //move to FanucScriptUI modeName.text = "Mode: Joints"; speedText.text = speed.ToString(); net = SceneManager.Net; mode = 0; Fanuc[4].transform.localRotation = Quaternion.Euler(0, jointAngles[4], 0); inputField.onEndEdit.AddListener(delegate { LockInput(inputField); }); CoordDisplayAndSave(); addPoint = FindObjectOfType <AddPoint>(); }
private void addPoint(Series targetSeries, double value) { if (chart.InvokeRequired) { AddPoint delegateAddPoint = new AddPoint(addPoint); chart.Invoke((EventHandler) delegate { delegateAddPoint(targetSeries, value); }); } else { targetSeries.Points.AddY(value); } }
public async Task <IActionResult> AddPointAsync(AddPoint point) { var existingPoint = await _unitOfWork.PointRepository.GetByCoords(point.Latitude, point.Longtitude); if (existingPoint == null) { existingPoint = new PointEntity() { Latitude = point.Latitude, Longtitude = point.Longtitude }; await _unitOfWork.PointRepository.AddAsync(existingPoint); await _unitOfWork.Commit(); } await _imageService.UploadImageToStorageAsync(existingPoint.Id.ToString(), point.Image); return(Ok(existingPoint.Id)); }
//IEnumerator MoveManager() //{ // yield return new WaitUntil(() => stopCoroutine == true); // StartCoroutine(SceneManager.fanuc.Move(FanucCoords)); //} // Update is called once per frame void Update() { if (Synchro) { for (int i = 0; i < NumberofObjects; ++i) { GameObject obj = SceneManager.Pull.Find(Names[i]); // obj.transform.rotation = RotationCoords[i]; if (obj) { if (obj.name == "fanuc") { if (SceneManager.fanuc.semafor == 0) { SceneManager.fanuc.speed = SceneManager.fanuc.standartSpeed; StartCoroutine(SceneManager.fanuc.Move(FanucCoords)); } else { SceneManager.fanuc.speed = SceneManager.fanuc.desyncSpeed; } } else if (obj.name == "telega") { Debug.Log(TelegaCoord[0] + " " + TelegaCoord[1] + "------------------------"); AddPoint.AddFromObserver(TelegaCoord[0], TelegaCoord[1]); SceneManager.telega.Synchronize(); } else { obj.transform.position = PositionCoords[i]; obj.SetActive(true); } //Debug.Log(Names[i] + " found"); } //else Debug.Log(i + " " + Names[i] + "Not Found"); } Synchro = false; } }
public TrackViewer(GCodeCollector code) { InitializeComponent(); Code = code; zoomSlider.ValueChanged += OnSliderValueChanged; scrollViewer.ScrollChanged += OnScrollViewerScrollChanged; scrollViewer.MouseMove += Vaszon_MouseMove; scrollViewer.PreviewMouseRightButtonUp += OnMouseRightButtonUp; scrollViewer.PreviewMouseRightButtonDown += OnMouseRightButtonDown; scrollViewer.PreviewMouseWheel += OnPreviewMouseWheel; RemoveBtn.Click += (s, e) => { RemovePoint?.Invoke(_p - 1); SetPosition(_p); }; Vaszon.MouseUp += (s, e) => { if (!Keyboard.IsKeyDown(Key.LeftCtrl)) { return; } System.Windows.Point currentPosition = e.GetPosition(Vaszon); currentPosition.X -= ShiftView.X; currentPosition.Y -= ShiftView.Y; AddPoint?.Invoke(_p, currentPosition); var line = Vaszon.Children[Vaszon.Children.Count - 2] as Line; SetPosition(_p + 1); }; jelolo = new Ellipse(); jelolo.Fill = Brushes.Yellow; jelolo.Stroke = Brushes.Black; jelolo.Width = 1; jelolo.Height = 1; jelolo.StrokeThickness = 0.2; jelolo.MouseEnter += (s, e) => { Mouse.OverrideCursor = Cursors.Hand; }; jelolo.MouseLeave += (s, e) => { Mouse.OverrideCursor = null; }; jelolo.MouseDown += (s, e) => { mozog = true; jelolo.CaptureMouse(); }; jelolo.MouseUp += (s, e) => { mozog = false; jelolo.ReleaseMouseCapture(); }; jelolo.MouseMove += (s, e) => { if (!mozog) { return; } System.Windows.Point currentPosition = e.GetPosition(Vaszon); Canvas.SetLeft(jelolo, currentPosition.X - jelolo.Width / 2); Canvas.SetTop(jelolo, currentPosition.Y - jelolo.Height / 2); var line = Vaszon.Children[Vaszon.Children.Count - 2] as Line; line.X2 = currentPosition.X; line.Y2 = currentPosition.Y; var l = line.DataContext as GCodeLine; currentPosition.X -= ShiftView.X; currentPosition.Y -= ShiftView.Y; l.x = currentPosition.X; l.y = currentPosition.Y; }; }