Ejemplo n.º 1
0
        private void Find_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            string findName = FindBar.Text;

            DataSectionStack.Children.Clear();
            currentPrograms.Clear();
            currentPrograms = ProgramDataService.FindByName(findName);

            if (currentPrograms != null && currentPrograms.Count > 0)
            {
                PrintCurrentPrograms();
            }

            UndoRedoStack.Command command = new UndoRedoStack.Command(() => {
                DataSectionStack.Children.Clear();
                currentPrograms.Clear();
                currentPrograms = ProgramDataService.FindByName(findName);

                if (currentPrograms != null && currentPrograms.Count > 0)
                {
                    PrintCurrentPrograms();
                }
            });
            undoRedo.AddAction(command);
        }
Ejemplo n.º 2
0
        private void Filters_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            if (ByNameButton.IsChecked == true)
            {
                UndoRedoStack.Command command = new UndoRedoStack.Command(() => {
                    SortByName();
                    PrintCurrentPrograms();
                });
                undoRedo.AddAction(command);

                SortByName();
                PrintCurrentPrograms();
                ByNameButton.IsChecked = false;
            }
            else if (ByPriceButton.IsChecked == true)
            {
                UndoRedoStack.Command command = new UndoRedoStack.Command(() => {
                    SortByPrice();
                    PrintCurrentPrograms();
                });
                undoRedo.AddAction(command);

                SortByPrice();
                PrintCurrentPrograms();
                ByPriceButton.IsChecked = false;
            }
            else
            {
                MessageBox.Show("Please, choose type for filter...");
            }
        }
Ejemplo n.º 3
0
        private void CategorySort_Web_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            UndoRedoStack.Command command = new UndoRedoStack.Command(() => {
                DisplayPrograms(Category.WEB);
            });
            undoRedo.AddAction(command);

            DisplayPrograms(Category.WEB);
        }