public ConfigurationWindow(NovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService) {
            InitializeComponent();

            _configurableEngine = engine;
            _engine = engine;
            _downloader = engine.Settings.Downloader.SelectedItem as IConfigurable;
            _exceptionHandler = exceptionHandler;
            _dialogService = dialogService;
            _initialMovieDir = engine.MovieDirectory;
            _initialTvShowDir = engine.TvShowDirectory;

            _engineSettings = engine.Settings;

            var utor = _downloader as UTorrentDownloader;
            if (utor != null && utor.IsAvailable) {
                _torrentSettings = utor.Settings;
                TorrentHowToHyperink.NavigateUri = new Uri(Properties.Resources.Url_HowToConfigureUtorrentWebUISettings);
            }
            else {
                var trantor = _downloader as TransmissionDownloader;
                if (trantor != null) {
                    _torrentSettings = trantor.Settings;
                    TorrentHowToHyperink.NavigateUri = new Uri(Properties.Resources.Url_HowToConfigureTransmissionWebUISettings);
                }
            }
            if (_torrentSettings == null)
                TorrentSettingsExpander.Visibility = Visibility.Collapsed;
            else if (_downloader != null)
                TorrentSettingsExpander.Tag = string.Format(Properties.Resources.TorrentWebUISettings, _downloader.SettingName);

            DataContext = this;

            Closing += OnClosing;
        }
Пример #2
0
        public ConfigurationWindow(NovaromaEngine engine, IExceptionHandler exceptionHandler, IDialogService dialogService)
        {
            InitializeComponent();

            _configurableEngine = engine;
            _engine             = engine;
            _downloader         = engine.Settings.Downloader.SelectedItem as IConfigurable;
            _exceptionHandler   = exceptionHandler;
            _dialogService      = dialogService;
            _initialMovieDir    = engine.MovieDirectory;
            _initialTvShowDir   = engine.TvShowDirectory;

            _engineSettings = engine.Settings;

            var utor = _downloader as UTorrentDownloader;

            if (utor != null && utor.IsAvailable)
            {
                _torrentSettings = utor.Settings;
                TorrentHowToHyperink.NavigateUri = new Uri(Properties.Resources.Url_HowToConfigureUtorrentWebUISettings);
            }
            else
            {
                var trantor = _downloader as TransmissionDownloader;
                if (trantor != null)
                {
                    _torrentSettings = trantor.Settings;
                    TorrentHowToHyperink.NavigateUri = new Uri(Properties.Resources.Url_HowToConfigureTransmissionWebUISettings);
                }
            }
            if (_torrentSettings == null)
            {
                TorrentSettingsExpander.Visibility = Visibility.Collapsed;
            }
            else if (_downloader != null)
            {
                TorrentSettingsExpander.Tag = string.Format(Properties.Resources.TorrentWebUISettings, _downloader.SettingName);
            }

            DataContext = this;

            Closing += OnClosing;
        }