/// <summary> /// Creates a new NoteSettingsDialog form associated with the given /// NoteForm. We position ourselves so we are "stuck" to the side of the /// given NoteForm at all times. /// </summary> public NoteSettingsDialog(NoteForm noteForm) { noteForm_ = noteForm; InitializeComponent(); this.Icon = Media.StickiesIcon; this.Text = Messages.NoteSettingsTitle; this.StartPosition = FormStartPosition.Manual; this.Location = DeterminePosition(); noteForm_.FormClosed += new FormClosedEventHandler(noteForm__FormClosed); noteForm_.Move += new EventHandler(noteForm__Changed); noteForm_.Resize += new EventHandler(noteForm__Changed); }
/// <summary> /// Creates a new note under the current mouse position. /// </summary> private void NewNote() { Note note = (Note) preferences_.Note.Copy(); note.Guid = Guid.NewGuid().ToString(); note.Left = Control.MousePosition.X - note.Width / 2; note.Top = Control.MousePosition.Y - note.Height / 2; NoteForm noteForm = new NoteForm(this, note, true); ShowNote(noteForm); noteForm.Activate(); }
/// <summary> /// Deletes all the visible sticky notes. /// </summary> private void DeleteAllNotes() { NoteForm[] notes = new NoteForm[noteForms_.Count]; noteForms_.CopyTo(notes); foreach (NoteForm noteForm in notes) { noteForm.Delete(false); } }
/// <summary> /// Registers and displays the given NoteForm. /// </summary> private void ShowNote(NoteForm noteForm) { noteForms_.Add(noteForm); noteForm.HandleDestroyed += new EventHandler(NoteForm__HandleDestroyed); noteForm.Show(); UpdateMenus(); }