示例#1
0
        void TorrentFound(object sender, TorrentWatcherEventArgs args)
        {
            if(!SettingsManager.Preferences.ImportEnabled)
                return;

            logger.Info("New torrent detected, adding " + args.TorrentPath);
            GLib.Timeout.Add (1000, delegate {
                LoadTorrent (args.TorrentPath, false);
                return false;
            });
        }
示例#2
0
 void watcher_TorrentFound(object sender, TorrentWatcherEventArgs e)
 {
     //try
       //{
       //    Torrent t = Torrent.Load(e.TorrentPath);
       //    TrackerEngine.Instance.Tracker.Add(t);
       //}
       //catch (Exception ex)
       //{
       //    Console.WriteLine("Couldn't load {0}.", e.TorrentPath);
       //    Console.WriteLine("Reason: {0}", ex.Message);
       //}
 }
示例#3
0
 void watcher_TorrentLost(object sender, TorrentWatcherEventArgs e)
 {
     //try
       //{
       //    TrackerEngine.Instance.Tracker.Remove(e.TorrentPath);
       //}
       //catch(Exception ex)
       //{
       //    Console.WriteLine("Couldn't remove torrent: {0}", e.TorrentPath);
       //    Console.WriteLine("Reason: {0}", ex.Message);
       //}
 }
示例#4
0
        void TorrentFound(object o, TorrentWatcherEventArgs e)
        {
            Torrent torrent = null;
            try
            {
                torrent = Torrent.Load(e.TorrentPath);
            }
            catch(Exception ex)
            {
                AddHistory("Could not load: {0}. Reason: {1}", e.TorrentPath, ex.Message);
            }

            InfoHashTrackable trackable = new InfoHashTrackable(torrent);
            tracker.Add(trackable);
        }