Пример #1
0
        /// <summary>
        /// Задать новое значение выбранной озвучке
        /// </summary>
        private void SetVoiceOverValue()
        {
            _selectedGlobalVoiceOver = GlobalVoiceOvers
                                       .FirstOrDefault(gvo => gvo.CartoonVoiceOverId == SelectedVoiceOverId);
            NotifyOfPropertyChange(() => SelectedGlobalVoiceOver);
            NotifyGlobalVoiceOversButtons();

            if (SelectedCartoon != null)
            {
                if (SelectedEpisode != null)
                {
                    _selectedEpisodeVoiceOver = EpisodeVoiceOvers
                                                .FirstOrDefault(evo => evo.CartoonVoiceOverId == SelectedVoiceOverId);
                    NotifyOfPropertyChange(() => SelectedEpisodeVoiceOver);
                    NotifyEpisodeVoiceOversButtons();
                }

                _selectedCartoonVoiceOver = CartoonVoiceOvers
                                            .FirstOrDefault(evo => evo.CartoonVoiceOverId == SelectedVoiceOverId);

                NotifyOfPropertyChange(() => SelectedCartoonVoiceOver);
                NotifyCartoonVoiceOversButtons();
            }

            NotifySharedVoiceOversButtons();
        }
Пример #2
0
        private void SelectVoiceOver()
        {
            if (CartoonVoiceOvers.Count == 0 &&
                EpisodeVoiceOvers.Count == 0)
            {
                SelectedGlobalVoiceOver = GlobalVoiceOvers.Count > 0
                                        ? GlobalVoiceOvers.Last()
                                        : null;
                return;
            }

            if (EpisodeVoiceOvers.Count > 0)
            {
                SelectedEpisodeVoiceOver = EpisodeVoiceOvers.Last();
                return;
            }

            if (CartoonVoiceOvers.Count > 0)
            {
                SelectedCartoonVoiceOver = CartoonVoiceOvers.Last();
                return;
            }

            if (SelectedVoiceOverId > 0)
            {
                SelectedGlobalVoiceOver = GlobalVoiceOvers
                                          .FirstOrDefault(gvo => gvo.CartoonVoiceOverId == SelectedVoiceOverId);
            }
        }