public void DeselectNote(SelectedSNote note) { if (SelectedNotesHashset.Contains(note)) { SelectedNotesHashset.Remove(note); } UpdateSelectedNoteBoundsRectangle(); }
public void SelectNote(SelectedSNote note) { if (SelectedNotesBounds.HasValue) { SelectedNotesBounds = SelectedNotesBounds.Value.CombineBoundsWith(note.GetBoundsRectangle()); } else { SelectedNotesBounds = note.GetBoundsRectangle(); } SelectedNotesHashset.Add(note); }
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; }
public void DeselectAllNotes() { SelectedNotesHashset.Clear(); UpdateSelectedNoteBoundsRectangle(); }
public bool IsNoteSelected(SelectedSNote note) { return(SelectedNotesHashset.Contains(note)); }