Example #1
0
 public void DeselectNote(SelectedSNote note)
 {
     if (SelectedNotesHashset.Contains(note))
     {
         SelectedNotesHashset.Remove(note);
     }
     UpdateSelectedNoteBoundsRectangle();
 }
Example #2
0
 public void SelectNote(SelectedSNote note)
 {
     if (SelectedNotesBounds.HasValue)
     {
         SelectedNotesBounds = SelectedNotesBounds.Value.CombineBoundsWith(note.GetBoundsRectangle());
     }
     else
     {
         SelectedNotesBounds = note.GetBoundsRectangle();
     }
     SelectedNotesHashset.Add(note);
 }
Example #3
0
        void UpdateSelectedNoteBoundsRectangle()
        {
            if (SelectedNotesHashset.Count == 0)
            {
                SelectedNotesBounds = null;
                return;
            }

            var rect = SelectedNotesHashset.First().GetBoundsRectangle();

            foreach (var n in SelectedNotesHashset)
            {
                rect = rect.CombineBoundsWith(n.GetBoundsRectangle());
            }

            SelectedNotesBounds = rect;
        }
Example #4
0
 public void DeselectAllNotes()
 {
     SelectedNotesHashset.Clear();
     UpdateSelectedNoteBoundsRectangle();
 }
Example #5
0
 public bool IsNoteSelected(SelectedSNote note)
 {
     return(SelectedNotesHashset.Contains(note));
 }