예제 #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
파일: TrackerHost.cs 프로젝트: mono/tsunami
        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);
        }