private void ExecutePasteCommand() { X9aFile.Voice[] voices = Clipboard.GetData("X9AVoice") as X9aFile.Voice[]; if (voices == null) { return; } VoiceViewModel firstSelectedVoice = SelectedVoices.OrderBy(voice => voice.Index).FirstOrDefault(); if (firstSelectedVoice == null) { return; } for (int i = 0; i < voices.Length; i++) { if (firstSelectedVoice.Index + i >= Voices.Count) { break; } Voices[firstSelectedVoice.Index + i].Voice = voices[i]; } }
private void ExecuteMoveDownCommand() { VoiceViewModel[] sortedSelectedVoices = SelectedVoices.OrderByDescending(voice => voice.Index).ToArray(); foreach (VoiceViewModel voice in sortedSelectedVoices) { Voices.Move(voice.Index, voice.Index + 1); VoiceViewModel voiceBelow = Voices.Single(v => v.Index == voice.Index + 1); if (voice.LiveSetIndex < 8) { voice.LiveSetIndex++; } else { voice.LiveSetIndex = 1; voice.LiveSetPage++; } if (voiceBelow.LiveSetIndex > 1) { voiceBelow.LiveSetIndex--; } else { voiceBelow.LiveSetIndex = 8; voiceBelow.LiveSetPage--; } } }
private void ExecuteCopyCommand() { X9aFile.Voice[] voices = SelectedVoices.OrderBy(voice => voice.Index).Select(v => v.Voice).ToArray(); Clipboard.SetData("X9AVoice", voices); }
private bool CanExecuteMoveDownCommand() { return(SelectedVoices.Count > 0 && !SelectedVoices.Any(v => v.LiveSetPage == 20 && v.LiveSetIndex == 8)); }