protected override void OnExecuted(EventArgs e) { base.OnExecuted(e); var form = (MainForm)Application.Instance.MainForm; if (form.Notes.Count == 0) { MessageBox.Show(form, "No notes available.", MessageBoxButtons.OK, MessageBoxType.Error); return; } var note = form.Notes.CurrentNote; var dialog = new Dialogs.Input("Rename Note", "Rename note '" + note.Name + "'"); dialog.Data = note.Name; if (dialog.ShowModal(Application.Instance.MainForm)) { if (note.Rename(dialog.Data)) { form.Notes.ListBox.Invalidate(); } else { MessageBox.Show(form, "A note with that name already exists!", MessageBoxButtons.OK, MessageBoxType.Error); } } }
protected override void OnExecuted(EventArgs e) { base.OnExecuted(e); var form = (MainForm)Application.Instance.MainForm; var dialog = new Dialogs.Input("New Note", "Create new note"); if (dialog.ShowModal(Application.Instance.MainForm)) { form.Notes.AddNote(dialog.Data); } }
protected override void OnActivated(EventArgs e) { base.OnActivated(e); var form = (MainForm)Application.Instance.MainForm; var dialog = new Dialogs.Input("New Note", "Create new note"); if (dialog.ShowDialog(Application.Instance.MainForm) == DialogResult.Ok) { form.Notes.AddNote(dialog.Data); } }
protected override void OnActivated(EventArgs e) { base.OnActivated(e); var form = (MainForm)Application.Instance.MainForm; var dialog = new Dialogs.Input("New Note", "Create new note"); if (dialog.ShowDialog(Application.Instance.MainForm) == DialogResult.Ok) { form.Notes.AddNote(dialog.Data); } }
protected override void OnExecuted(EventArgs e) { base.OnExecuted(e); var form = (MainForm)Application.Instance.MainForm; var dialog = new Dialogs.Input("New Note", "Create new note"); if (dialog.ShowModal(Application.Instance.MainForm)) { form.Notes.AddNote(dialog.Data); } }
protected override void OnActivated(EventArgs e) { base.OnActivated(e); var form = (MainForm)Application.Instance.MainForm; if (form.Notes.Count == 0) { MessageBox.Show(form, "No notes available.", MessageBoxButtons.OK, MessageBoxType.Error); return; } var dialog = new Dialogs.Input("Rename Note", "Rename note '" + form.Notes.CurrentNote.Name + "'"); if (dialog.ShowDialog(Application.Instance.MainForm) == DialogResult.Ok) { if (form.Notes.CurrentNote.Rename(dialog.Data)) { form.Notes.ListBox.Invalidate(); } else MessageBox.Show(form, "A note with that name already exists!", MessageBoxButtons.OK, MessageBoxType.Error); } }