예제 #1
0
 public void RestoreWatchers()
 {
     foreach (string feed in feeds)
     {
         TorrentRssWatcher watcher = new TorrentRssWatcher(feed);
         watcher.TorrentFound += delegate(object o, TorrentRssWatcherEventArgs e) {
             GLib.Idle.Add(delegate {
                 OnTorrentMatched(o, e);
                 return(false);
             });
         };
         watchers.Add(feed, watcher);
     }
 }
예제 #2
0
        public bool AddWatcher(string url)
        {
            if (watchers.ContainsKey(url))
            {
                return(false);
            }

            TorrentRssWatcher watcher = new TorrentRssWatcher(url);

            feeds.Add(url);
            watcher.TorrentFound += delegate(object o, TorrentRssWatcherEventArgs e) {
                GLib.Idle.Add(delegate {
                    OnTorrentMatched(o, e);
                    return(false);
                });
            };
            watchers.Add(url, watcher);
            watcher.StartWatching();
            return(true);
        }