예제 #1
0
 private void BackBtn_OnClicked(object sender, EventArgs e)
 {
     Back?.Invoke(this, EventArgs.Empty);
     PropertyInfoContainer.IsVisible = false;
     PropertyNameLbl.Text            = string.Empty;
     ControlNameLbl.IsVisible        = true;
 }
        internal WizardEventArgs FireBackEvent(int currentTabIndex)
        {
            var ev = new WizardEventArgs(currentTabIndex, Direction.Backward);

            Back?.Invoke(this, ev);
            return(ev);
        }
예제 #3
0
 /// <summary>
 /// Raises event 'Back'
 /// </summary>
 protected virtual void OnBack()
 {
     if (Back != null)
     {
         Back.Invoke(this, System.EventArgs.Empty);
     }
 }
        // TODO: Exercise 4: Task 4a: Enable a teacher to remove a student from a class
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            if (SessionContext.UserRole == Role.Teacher)
            {
                try
                {
                    Student selectedStudent = SessionContext.CurrentStudent;

                    if (MessageBox
                        .Show($"Remove {selectedStudent.FirstName} {selectedStudent.LastName} from class?"
                              , "Confirm remove."
                              , MessageBoxButton.YesNo)
                        .Equals(MessageBoxResult.Yes))
                    {
                        SessionContext.CurrentTeacher.RemoveFromClass(selectedStudent);
                        Back?.Invoke(sender, e);    // Going back to the previous page.
                    }
                }
                catch
                {
                    MessageBox.Show("Some bad stuff happened, closing application", "Exception caught");
                    throw;
                }
            }
        }
예제 #5
0
 private void Button_KeyDown_Back(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Left)
     {
         Back?.Invoke(this, new RoutedEventArgs());
     }
 }
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            if (SessionContext.UserRole != Role.Teacher)
            {
                return;
            }

            Back?.Invoke(sender, e);
        }
예제 #7
0
 public NextBack()
 {
     InitializeComponent();
     OKButton.Clicked   += (object sender, EventArgs e) => { Sound.OK(); OK?.Invoke(this, e); };
     NextButton.Clicked += (object sender, EventArgs e) => { Sound.OK(); Next?.Invoke(this, e); };
     BackButton.Clicked += (object sender, EventArgs e) => { Sound.NG(); Back?.Invoke(this, e); };
     OKButton.Command    = new Command(() => { Sound.OK(); ClickButton?.Execute(BUTTON_TYPE.OK); });
     NextButton.Command  = new Command(() => { Sound.OK(); ClickButton?.Execute(BUTTON_TYPE.NEXT); });
     BackButton.Command  = new Command(() => { Sound.OK(); ClickButton?.Execute(BUTTON_TYPE.BACK); });
 }
예제 #8
0
 private void BtnPrev_Click(object sender, EventArgs e)
 {
     if (QuestionNumber > 0)
     {
         PreviousQuestion?.Invoke(this, rbGroup.CheckedRadioButtonId);
     }
     else
     {
         Back?.Invoke(this, EventArgs.Empty);
     }
 }
예제 #9
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (this.Check())
     {
         this.FülleFelder();
         us.Erstellen();
         MessageBox.Show("Success");
         Global.Context.SaveChanges();
         Back.Invoke(this, EventArgs.Empty);
         clear();
     }
 }
예제 #10
0
        /// <summary>
        /// 关闭当前窗口事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TCloseButton_Click(object sender, RoutedEventArgs e)
        {
            //System.Windows.Application.Current.Host.Content.IsFullScreen = System.Windows.Application.Current.Host.Content.IsFullScreen ? false : true;
            ICleanup content = PanelContent as ICleanup;

            if (content != null)
            {
                content.Cleanup();
                PanelContent = null;
            }
            if (Back != null)
            {
                Back.Invoke(sender, e);
            }
        }
예제 #11
0
        //Safe Button
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (Check())
            {
                Data.Userstory us = Data.Userstory.LesenID(id);
                us.Title            = Title.Text;
                us.Text             = Story.Text;
                us.DefinitionOfDone = DOD.Text;
                us.Phase            = phasenBox.Text;
                us.CreatedAt        = Date.SelectedDate ?? DateTime.Today;
                us.ShowInBacklog    = Show.IsChecked ?? false;
                us.StoryPoints      = Convert.ToInt32(StoryPoints.Text);
                us.Aktualisieren();

                Back.Invoke(this, EventArgs.Empty);
            }
        }
예제 #12
0
 public void ShowBack(CustomNavigationPage customNavigationPage)
 {
     try
     {
         this.Navigation.InsertPageBefore(new Page(), this);
         customNavigationPage.PopView = (page) =>
         {
             if (page == this)
             {
                 Back.Invoke();
                 return(true);
             }
             return(false);
         };
     }
     catch (Exception e)
     {
         ExceptionHandler.Catch(e);
     }
 }
예제 #13
0
        private void HandleInput(IMenuItemInfo[] options, ref int selected)
        {
            var key = Console.ReadKey(true).Key;

            switch (key)
            {
            case ConsoleKey.UpArrow:
                if (selected <= 0)
                {
                    selected = options.GetUpperBound(0);
                }
                else
                {
                    selected--;
                }
                break;

            case ConsoleKey.DownArrow:
                if (selected >= options.GetUpperBound(0))
                {
                    selected = 0;
                }
                else
                {
                    selected++;
                }
                break;

            case ConsoleKey.Backspace:
            case ConsoleKey.Escape:
                Back?.Invoke(this, EventArgs.Empty);
                selected = -1;
                break;

            case ConsoleKey.Enter:
                Chosen?.Invoke(this, new MenuItemInfoEventArgs(options[selected]));
                selected = -1;
                break;
            }
        }
        private void Remove_Click(object sender, RoutedEventArgs e)
        {
            if (SessionContext.UserRole != Role.Teacher)
            {
                return;
            }

            try
            {
                var message = $"Remove {SessionContext.CurrentStudent.FirstName} {SessionContext.CurrentStudent.LastName}";
                var reply   = MessageBox.Show(message, "Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question);

                if (reply == MessageBoxResult.Yes)
                {
                    SessionContext.CurrentTeacher.RemoveFromClass(SessionContext.CurrentStudent);

                    Back?.Invoke(sender, e);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error removing student from class", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
예제 #15
0
 //Abbrechen Button
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     Back.Invoke(this, EventArgs.Empty);
 }
예제 #16
0
 //Delete Button
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     Data.Userstory.LesenID(id).Loeschen();
     Back.Invoke(this, EventArgs.Empty);
 }
예제 #17
0
 private void btn_Back_Click(object o, EventArgs e)
 {
     Back?.Invoke();
 }
예제 #18
0
 protected void OnBack(BeforeNavigateEventArgs args)
 {
     Back?.Invoke(this, args);
 }
예제 #19
0
 protected virtual void OnBack()
 {
     Back?.Invoke(this, EventArgs.Empty);
 }
예제 #20
0
 private void OnButtonAddProductsClick(object o, EventArgs e)
 {
     Back?.Invoke();
 }
 private void OnButtonCancelDeliveryClick(object o, EventArgs e)
 {
     Back?.Invoke();
 }
예제 #22
0
 private void OnButtonBackClick(object o, EventArgs e)
 {
     Back?.Invoke();
 }
 private void OnBackButtonClick(object Sender, RoutedEventArgs E)
 {
     Back?.Invoke(this, EventArgs.Empty);
 }
예제 #24
0
 private void exitFullscreenButton_Click(object sender, EventArgs e)
 {
     Back?.Invoke();
 }
 private void BackwardButton_Click(object sender, RoutedEventArgs e) => Back?.Invoke(this, new RoutedEventArgs());
예제 #26
0
 private void IconButtonRound_Click(object sender, RoutedEventArgs e)
 {
     Back?.Invoke(sender, e);
 }
예제 #27
0
 private void OnButtonExitClick(object sender, EventArgs e)
 {
     Back?.Invoke();
 }
예제 #28
0
 private void BtnMenu_Click(object sender, EventArgs e)
 {
     Back?.Invoke(this, EventArgs.Empty);
 }