Exemplo n.º 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"]));
        }
Exemplo n.º 2
0
 public void Initialize()
 {
     // Initialize data accessor with API key and default language code.
     m_accessor = new TMDBAccessor("1832136f1eaafcbfa0dec5c053322997", "en");
 }