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--; } } }
public MainPage() { this.InitializeComponent(); _media = new MediaElement(); _speech = new SpeechSynthesizer(); SelectedVoice = Voices[0]; _speech.Voice = SelectedVoice.VoiceInformation; }
private void SelectedVoiceComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { SelectedVoice = e.AddedItems[0] as VoiceViewModel; _speech.Voice = SelectedVoice.VoiceInformation; }
internal async void Navigate(DiscordChannel channel, NavigationTransitionInfo info = null) { try { CloseSplitPane(); unreadDms.SelectionChanged -= UnreadDms_SelectionChanged; guildsList.SelectionChanged -= GuildsList_SelectionChanged; guildsList.SelectedIndex = -1; unreadDms.SelectedIndex = -1; friendsItem.IsSelected = false; if (channel == null) { friendsItem.IsSelected = true; sidebarFrame.Navigate(typeof(DMChannelsPage), channel, new DrillInNavigationTransitionInfo()); Frame.Navigate(typeof(FriendsPage)); return; } if (await WindowManager.ActivateOtherWindow(channel)) { return; } if (channel is DiscordDmChannel dm) { unreadDms.SelectedItem = dm; friendsItem.IsSelected = true; if (!(sidebarFrame.Content is DMChannelsPage)) { sidebarFrame.Navigate(typeof(DMChannelsPage), channel, new DrillInNavigationTransitionInfo()); } } else if (channel.Guild != null) { guildsList.SelectedIndex = _guilds.IndexOf(channel.Guild); if (!(sidebarFrame.Content is GuildChannelListPage p) || p.Guild != channel.Guild) { sidebarFrame.Navigate(typeof(GuildChannelListPage), channel.Guild, new DrillInNavigationTransitionInfo()); } } if (channel.Type == ChannelType.Voice) { var voice = await VoiceViewModel.StartNewAsync(channel); return; } if (!(Frame.Content is ChannelPage cPage) || cPage.ViewModel?.Channel?.Id != channel.Id) { if (channel.IsNSFW) { if (await WindowsHelloManager.VerifyAsync(Constants.VERIFY_NSFW, "Verify your identity to access this channel")) { if (!App.RoamingSettings.Read($"NSFW_{channel.Id}", false) || !App.RoamingSettings.Read($"NSFW_All", false)) { Frame.Navigate(typeof(ChannelWarningPage), channel, info ?? new SlideNavigationTransitionInfo()); } else { Frame.Navigate(typeof(ChannelPage), channel, info ?? new SlideNavigationTransitionInfo()); } } } else { Frame.Navigate(typeof(ChannelPage), channel, info ?? new SlideNavigationTransitionInfo()); } } } finally { unreadDms.SelectionChanged += UnreadDms_SelectionChanged; guildsList.SelectionChanged += GuildsList_SelectionChanged; } }