Beispiel #1
0
 void InitializeTorrentData()
 {
     _torrentData = new TorrentData();
 }
Beispiel #2
0
        void Initialize()
        {
            //Object Creation
            parser = new Parser();
            torrentData = new Buddy.Objects.Torrent.TorrentData();
            webPageQueue = new List<string>();
            timer = new System.Timers.Timer(1000 * updateFrequencyinSeconds);

            logFile = new Conrad_Lib.File();

            //Event assignment
            torrentData.NeedsDataToUpdate += PerformSearch;
            torrentData.NewEpisodeFound += NewEpisodeFoundHandler;
            torrentData.SeriesCompletedScan += SeriesCompletedScanHandler;

            Load += HideWindow;
            timer.Elapsed += TimeElapsed;

            //Display Updates
            Display_EpisodeData.Text = torrentData.EpisodeData();
            trayIcon = new NotifyIcon();
            trayIcon.Icon = new Icon(@"Z:\Program Files\Visual Prolog 7.5\icons\categories\applications-system.ico");
            trayIcon.Text = "Buddy\nNo new notifications";
            trayIcon.Visible = true;
            trayIcon.MouseDoubleClick += ShowWindow;

            ContextMenu trayIconContextMenu = new ContextMenu();
            MenuItem menu_exit = new MenuItem();
            menu_exit.Text = "Exit";
            menu_exit.Index = 0;
            menu_exit.Click += ExitForm;
            trayIconContextMenu.MenuItems.Add(menu_exit);
            trayIcon.ContextMenu = trayIconContextMenu;

            //Timer
            timer.AutoReset = true;
            timer.Start();
            BackgroundWorker bg = new BackgroundWorker();
            bg.DoWork += UpdateTimerDisplay;
            bg.RunWorkerAsync();

            //Log File
            logFile.SetDirectory(System.Environment.CurrentDirectory);
            logFile.SetFileName(FILENAME_LOGFILE);
            logFile.Load();
        }