public void populateCommandSelections(CommandSelections selections) { selections.ClearModel(); if (PartNode != null) { selections.SelectedPart = PartNode.getPart(); } foreach (MeasureTreeNode node in MeasureNodes) { selections.SelectedMeasure.Add(node.getMeasure()); } foreach (ChordTreeNode node in ChordNodes) { selections.SelectedChord.Add(node.getChord()); } foreach (NoteTreeNode node in NoteNodes) { selections.SelectedNote.Add(node.getNote()); } if (EffectNode != null) { selections.SelectedEffect = EffectNode.getEffect(); } }