Example #1
0
 public void MoveItemOnServer(Point3D position)
 {
     if (selectedItems.Count > 0)
     {
         GridItem3D item           = selectedItems[0];
         Point3D    serverPosition = TransformClientToServerCoords(position);
         item.MoveItemOnServer(new Point3D(serverPosition.X, serverPosition.Y, 0));
     }
 }
        private void OnPositionChangeClick(object sender, System.Windows.RoutedEventArgs e)
        {
            if (grid.selectedItems.Count == 1)
            {
                GridItem3D item = grid.selectedItems[0];

                try
                {
                    double  x     = Convert.ToDouble(MachinePositionXBox.Text);
                    double  y     = Convert.ToDouble(MachinePositionYBox.Text);
                    Point3D point = new Point3D(x, y, 0);
                    item.MoveItemOnServer(point);
                }
                catch (FormatException)
                {
                    Point3D point = grid.TransformClientToServerCoords(item.position);
                    SetMaschinePositionBoxValue(point);
                }
            }
        }