Пример #1
0
        //Кнопка Удалить заметку
        private void XDelNote_Click(object sender, RoutedEventArgs e)
        {
            if (DataBaseOfNotes.NoteForShow.Count == 0)
            {
                MessageBox.Show("Заметка на удаление не выбрана.", "Информация", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            DeleteСonfirmation deleteСonfirmation = new DeleteСonfirmation();

            if (deleteСonfirmation.ShowDialog() == true)
            {
                try
                {
                    DataBaseOfNotes.AllNotesCollection.Remove(DataBaseOfNotes.NoteForShow[0]);
                    XListBoxAllNotes.Items.Refresh();
                }
                catch
                {
                    DataBaseOfNotes.NoteForShow.Clear();
                    ShowNote.ClearDemonstrationWindow(this);
                    SavedAndLoaded.SavingNotes(DataBaseOfNotes.AllNotesCollection);
                }
            }
        }
Пример #2
0
        // Выбор заметки из списка заметок Просмотр на дату
        private void XListBoxToSeeOnDate_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataBaseOfNotes.NoteForShow.Clear();
            DataBaseOfNotes.NoteForShow.Add(XListBoxToSeeOnDate.SelectedValue as SinglNote);
            ShowNote.Demonstration(DataBaseOfNotes.NoteForShow, this);

            try
            {
                XListBoxAllNotes.SelectedValue = null;
            }
            catch
            {
            }
        }
Пример #3
0
        public MainWindow()
        {
            InitializeComponent();
            SavedAndLoaded.LoadingNotes(DataBaseOfNotes.AllNotesCollection);
            XListBoxAllNotes.ItemsSource = DataBaseOfNotes.AllNotesCollection;

            foreach (var e in DataBaseOfNotes.AllNotesCollection)
            {
                if (e.TimeOfRepeatRead == DateTime.Now || (e.TimeOfRepeatRead < DateTime.Now && e.TimeOfRepeatRead != DateTime.MinValue))
                {
                    if (DataBaseOfNotes.DateNotesCollection.Contains(e) == false)
                    {
                        DataBaseOfNotes.DateNotesCollection.Add(e);
                    }
                }
            }

            XListBoxToSeeOnDate.ItemsSource = DataBaseOfNotes.DateNotesCollection;

            if (DataBaseOfNotes.NoteForShow.Count != 0)
            {
                ShowNote.Demonstration(DataBaseOfNotes.NoteForShow, this);
            }
        }