예제 #1
0
        public FormEditNote(MyNote.Tables.Note note)
        {
            InitializeComponent();
            this.note = note;

            this.txtTitle.Text   = note.Title;
            this.txtContent.Text = note.Content;
        }
예제 #2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            MyNote.Tables.Note note = this.note;

            note.Title   = this.txtTitle.Text;
            note.Content = this.txtContent.Text;

            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
예제 #3
0
        private void btnAddNote_Click(object sender, EventArgs e)
        {
            FormAddNote frmAddNote = new FormAddNote();

            if (frmAddNote.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                MyNote.Tables.Note note = frmAddNote.NewNote;

                this.database.Insert(note);

                this.UpdateAllNotes();
            }
        }
예제 #4
0
        private void lstNotes_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.lstNotes.SelectedIndex >= 0)
            {
                this.selectedNoteList.Clear();

                foreach (var item in this.lstNotes.SelectedItems)
                {
                    MyNote.Tables.Note note = item as MyNote.Tables.Note;
                    this.selectedNoteList.Add(note);
                }
            }

            UpdateSelectingUI();
        }
예제 #5
0
        private void lstNotes_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int index = this.lstNotes.IndexFromPoint(e.Location);

            if (index != System.Windows.Forms.ListBox.NoMatches)
            {
                MyNote.Tables.Note note = this.lstNotes.Items[index] as MyNote.Tables.Note;

                FormEditNote frmEditNote = new FormEditNote(note);
                if (frmEditNote.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    database.Update(note);

                    UpdateAllNotes();

                    UpdateSelectingUI();
                }
            }
        }