예제 #1
0
        public void Init()
        {
            var provider = new SampleAudioDramaProvider();

            _audioDramas = provider.Get().ToList();
            _searcher    = new AudioDramaSearcher();
        }
예제 #2
0
        public async Task Start()
        {
            var builder = new AudioDramaBuilder();

            var saver = new OnUserDataChangedInCacheSaver(_userDataCache);

            var source = new AudioDramaSource(
                _dtoCache,
                _userDataCache,
                builder,
                saver,
                _userNotifier);

            var audioDramaPresenter = new AudioDramaPresenter(_audioDramaView, _uriInvoker);

            var filterFactory = new AudioDramaFilterFactory();
            var sorterFactory = new AudioDramaSorterFactory();
            var searcher      = new AudioDramaSearcher();

            var explorer = new AudioDramaExplorer(source, searcher, filterFactory, sorterFactory);
            var picker   = new RandomAudioDramaPicker();

            var importExport = new UserDataImportExport(_userDataCache, _clipboardService, _yesNoDialog, _userNotifier,
                                                        _okDialog);

            var audioDramaListPresenter = new AudioDramaListPresenter(
                _audioDramaListView,
                explorer,
                _uriInvoker,
                importExport,
                source
                );

            var navigator = new Navigator(
                _rootView,
                audioDramaPresenter,
                audioDramaListPresenter,
                explorer,
                picker,
                source,
                _shutdown,
                _updatingView);

            navigator.ShowUpdateView();

            try
            {
                await source.Update();
            }
            catch (Exception)
            {
                // needed due to using async void. Otherwise
                // all exception will bubble up until here and crash the app.
                _userNotifier.Notify("Aktualisierung aus unbekannten Grund fehlgeschlagen.");
            }

            navigator.ShowStartView();
        }
        public void Init()
        {
            var provider = new SampleAudioDramaProvider();

            _audioDramas = provider.Get().ToList();
            var source = new Mock <ISource <IEnumerable <AudioDrama> > >();

            source.Setup(x => x.Get()).Returns(_audioDramas);

            var searcher      = new AudioDramaSearcher();
            var sorterFactory = new AudioDramaSorterFactory();
            var filterFactory = new AudioDramaFilterFactory();

            _explorer = new AudioDramaExplorer(source.Object, searcher, filterFactory, sorterFactory);
        }