Ejemplo n.º 1
0
 /// <summary>
 /// Кнопка редактировать.
 /// </summary>
 private void pictureBoxEdit_Click(object sender, EventArgs e)
 {
     if (NoteListBox.SelectedIndex != -1)
     {
         AddEditNoteForm addEditNote = new AddEditNoteForm(GetSelectedNote());
         DialogResult    result      = addEditNote.ShowDialog();
         if (result == DialogResult.OK)
         {
             _project.ListNote = _project.SortedListNote();
             ClearInterface();
             ProjectManager.Serializer(_project, path);
         }
         ComboBoxCategory_SelectedIndexChanged(sender, e);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Кнопка добавить.
        /// </summary>
        private void pictureBoxAdd_Click(object sender, EventArgs e)
        {
            AddEditNoteForm addEditNote = new AddEditNoteForm(new Note());
            DialogResult    result      = addEditNote.ShowDialog();

            if (result == DialogResult.OK)
            {
                _project.ListNote.Add(addEditNote.NewNote);
                if ((int)addEditNote.NewNote.Category == ComboBoxCategory.SelectedIndex || lenghtEnum + 1 == ComboBoxCategory.SelectedIndex)
                {
                    NoteListBox.Items.Add(addEditNote.NewNote.Name);
                }
                ProjectManager.Serializer(_project, path);
                ComboBoxCategory.SelectedIndex = ComboBoxCategory.SelectedIndex;
            }
        }