Esempio n. 1
0
        private void ChairUpdate()
        {
            ListBoxChair.ItemsSource = unitOfWork.Chairs
                                       .Find(item => item.FacultyId == LocalFaculty.FacultyId)
                                       .Select(item => new WebLibrary.Entities.Chair(item, unitOfWork, new HIndex()));

            ChairBox.ItemsSource   = unitOfWork.Chairs.GetAll().ToList();
            ChairBox.SelectedIndex = 0;
            ChairBox.RaiseEvent(new RoutedEventArgs(ComboBox.SelectedEvent));

            ResearcherUpdate();
        }
Esempio n. 2
0
        /// <inheritdoc />
        public override void Update(GameTime gameTime)
        {
            // Move the robot depending on key presses

            if (Game.CurrentKeyboardState.IsKeyDown(Keys.Right))
            {
                MoveRobot(Vector3.Left);
            }

            if (Game.CurrentKeyboardState.IsKeyDown(Keys.Left))
            {
                MoveRobot(Vector3.Right);
            }

            if (Game.CurrentKeyboardState.IsKeyDown(Keys.Up))
            {
                MoveRobot(Vector3.Backward);
            }

            if (Game.CurrentKeyboardState.IsKeyDown(Keys.Down))
            {
                MoveRobot(Vector3.Forward);
            }


            // Update Gizmos with the View Projection matrices
            Game.Gizmos.UpdateViewProjection(Camera.View, Camera.Projection);



            // Rotate the box
            ChairAngle += 0.01f;
            var rotation = Matrix.CreateRotationY(ChairAngle);

            ChairWorld           = ChairScale * rotation * ChairTranslation;
            ChairBox.Orientation = rotation;

            // Create an OBB World-matrix so we can draw a cube representing it
            ChairOBBWorld = Matrix.CreateScale(ChairBox.Extents * 2f) *
                            ChairBox.Orientation *
                            ChairTranslation;



            // Update the boolean values depending on the intersection of the Bounding Volumes
            TouchingChair      = ChairBox.Intersects(RobotBox);
            TouchingTank       = _tankSphere.Intersects(RobotBox);
            TouchingOtherRobot = !RobotTwoCylinder.Intersects(RobotBox).Equals(BoxCylinderIntersection.None);

            base.Update(gameTime);
        }
Esempio n. 3
0
        private void ResearcherChairDeleteButtonOnClick(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            var researcherToDelete = unitOfWork.Researchers.Get((int)button.Tag);

            string message = "Ви впевнені що хочете видалити дані про викладача "
                             + researcherToDelete.LastName + " "
                             + researcherToDelete.FirstName
                             + " " + researcherToDelete.MiddleName + "?";

            DialogWindow dialogWindow = new DialogWindow(message);
            bool?        dialogResult = dialogWindow.ShowDialog();

            if (dialogResult != true)
            {
                return;
            }

            unitOfWork.Researchers.Delete(researcherToDelete.ResearcherId);
            unitOfWork.Save();

            ChairBox.RaiseEvent(new RoutedEventArgs(ComboBox.SelectedEvent));
        }