Esempio n. 1
0
        public SearchWindowViewModel(ITvShowDatabase tvDatabaseService, string searchTerm, ITvShowRepository tvShowRepository, IEpisodeRepository episodeRepository, Guid windowId)
        {
            this._tvDatabaseService = tvDatabaseService;
            this._searchTerm        = searchTerm;
            this._tvShowRepository  = tvShowRepository;
            this._episodeRepository = episodeRepository;
            this._windowId          = windowId;

            this.OKCommand         = new DelegateCommand <object>(this.Execute_OKCommand);
            this.LoadedCommand     = new DelegateCommand <object>(this.Execute_LoadedCommand);
            this.SelectItemCommand = new DelegateCommand <TvShow>(this.Execute_SelectItemCommand);
            this.Shows             = new ObservableCollection <TvShow>();
        }
        public MainWindowViewModel(IUnityContainer container, IEpisodeRepository episodeRepository, ITorrentService torrentService, IEventAggregator eventAggregator, IServerRepository serverRepository, ITvShowDatabase tvShowDatabaseService, ITvShowRepository tvShowRepository, IMessageService messageService, IInternetService internetService)
        {
            this._container             = container;
            this._episodeRepository     = episodeRepository;
            this._torrentService        = torrentService;
            this._eventAggregator       = eventAggregator;
            this._serverRepository      = serverRepository;
            this._tvShowDatabaseService = tvShowDatabaseService;
            this._tvShowRepository      = tvShowRepository;
            this._messageService        = messageService;
            this._internetService       = internetService;

            this.SearchCommand                  = new DelegateCommand <object>(this.Execute_Search);
            this.StartDownloadCommand           = new DelegateCommand <object>(this.Execute_StartDownloadCommand);
            this.LoadedCommand                  = new DelegateCommand <Episode>(this.Execute_LoadedCommand);
            this.ExitCommand                    = new DelegateCommand <object>(this.Execute_ExitCommand);
            this.UpdateCommand                  = new DelegateCommand <object>(this.Execute_UpdateCommand);
            this.MarkEpisodeAsDownloadedCommand = new DelegateCommand <object>(this.Execute_MarkEpisodeAsDownloadedCommand);
            this.DeleteEpisodeCommand           = new DelegateCommand <object>(this.Execute_DeleteEpisodeCommand);
            this.GroupByCommand                 = new DelegateCommand <string>(this.Execute_GroupByCommand);
            this.EditEpisodeCommand             = new DelegateCommand <EpisodeDTO>(this.Execute_EditEpisodeCommand);
            this.SearchFilesCommand             = new DelegateCommand <object>(this.Execute_SearchFilesCommand);
            this.Episodes = new ObservableCollection <EpisodeDTO>();
            this.InitializeEpisodesViewSource();

            this.SearchAndDownloadButtonLabel = "Search Torrents";
            this.SearchAndDownloadButtonImage = "/images/TorrentIcon128x128.png";
        }