예제 #1
0
        public frmMain()
        {
            InitializeComponent();

            m_settings = new UserSettings();

            // Create accessor for TheMovieDb.
            TMDBAccessor tmdbAccessor = new TMDBAccessor(ConfigurationManager.AppSettings["TMDB_API_KEY"], "en");

            // Create data manager for Windows Media Center.
            string wmcCache = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Microsoft\\eHome";
            WMCDataManager wmcDataManager = new WMCDataManager(wmcCache + "\\DvdInfoCache", wmcCache + "\\DvdCoverCache");

            List<DataManager> dataManagers = new List<DataManager>();
            dataManagers.Add(wmcDataManager);

            // Create the library using the specified accessor and data manager(s).
            m_library = new LibraryManager(tmdbAccessor, dataManagers);
            m_library.MovieLoaded += new DataManagers.MovieLoadEventHandler(MovieLoadEventHandler);

            // Create the background fetcher and hook into events.
            m_fetcher = new BackgroundFetcher(m_library, this, int.Parse(ConfigurationManager.AppSettings["MAX_CONCURRENT_FETCHES"]));
        }
예제 #2
0
 public BackgroundFetcher(LibraryManager library, frmMain caller, int concurrentFetches = 5)
 {
     m_library = library;
     m_caller = caller;
     m_concurrentFetches = concurrentFetches;
 }
예제 #3
0
 public FetchWorker(LibraryManager library, ICollection<MovieEntry> processedEntries)
 {
     m_library = library;
     m_doneEvent = new ManualResetEvent(true);
     m_processedEntries = processedEntries;
 }