Пример #1
0
        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];
            }
        }
Пример #2
0
        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--;
                }
            }
        }
Пример #3
0
        private void ExecuteCopyCommand()
        {
            X9aFile.Voice[] voices = SelectedVoices.OrderBy(voice => voice.Index).Select(v => v.Voice).ToArray();

            Clipboard.SetData("X9AVoice", voices);
        }