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 ExecuteMoveUpCommand() { VoiceViewModel[] sortedSelectedVoices = SelectedVoices.OrderBy(voice => voice.Index).ToArray(); foreach (VoiceViewModel voice in sortedSelectedVoices) { Voices.Move(voice.Index, voice.Index - 1); VoiceViewModel voiceAbove = Voices.Single(v => v.Index == voice.Index - 1); if (voiceAbove.LiveSetIndex < 8) { voiceAbove.LiveSetIndex++; } else { voiceAbove.LiveSetIndex = 1; voiceAbove.LiveSetPage++; } if (voice.LiveSetIndex > 1) { voice.LiveSetIndex--; } else { voice.LiveSetIndex = 8; voice.LiveSetPage--; } } }
private void ExecuteCopyCommand() { X9aFile.Voice[] voices = SelectedVoices.OrderBy(voice => voice.Index).Select(v => v.Voice).ToArray(); Clipboard.SetData("X9AVoice", voices); }