コード例 #1
0
        private void addNoteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddEditForm AddNote = new AddEditForm();

            if (AddNote.ShowDialog() == DialogResult.OK)
            {
                _noteList.Notes.Add(AddNote._noteContainer);
                FillListView(_noteList.Notes);
                SaveFile(_noteList);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: TrueRedKain/TestRepo
        private void editNoteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddEditForm EditForm = new AddEditForm();
            int         EditInd  = NoteList.SelectedIndices[0];

            EditForm.NoteView(_noteList.Notes[EditInd]);
            if (EditForm.ShowDialog() == DialogResult.OK)
            {
                _noteList.Notes.RemoveAt(EditInd);
                NoteList.Items[EditInd].Remove();
                _noteList.Notes.Insert(EditInd, EditForm._noteContainer);
                FillListView(_noteList.Notes);
                SaveFile(_noteList);
            }
        }
コード例 #3
0
 private void editNoteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (NoteList.SelectedIndices.Count != 0)
     {
         int EditInd = (CategoriesComboBox.Text == "All") ? NoteList.SelectedIndices[0]
             : GetNoteIndex(_noteList.Notes, _projectForFind.Notes);
         AddEditForm EditForm = new AddEditForm();
         EditForm.NoteView(_noteList.Notes[EditInd]);
         if (EditForm.ShowDialog() == DialogResult.OK)
         {
             FillListView(_noteList.Notes);
             _noteList.Notes.RemoveAt(EditInd);
             NoteList.Items[EditInd].Remove();
             _noteList.Notes.Insert(EditInd, EditForm._noteContainer);
             SaveFile(_noteList);
             FilldListCategory();
         }
     }
 }