Пример #1
0
        public void UnregisterTorrent(ObjectPath torrent)
        {
            TorrentManagerAdapter d = downloaders[torrent];

            downloaders.Remove(torrent);
            TorrentService.Bus.Unregister(torrent);
            engine.Unregister(d.Manager);
        }
Пример #2
0
        private ObjectPath Load(TorrentAdapter tAdapter, TorrentSettings settings, TorrentManager manager)
        {
            ObjectPath managerPath  = new ObjectPath(string.Format(DownloaderPath, downloaderNumber++));
            ObjectPath settingsPath = new ObjectPath(string.Format("{0}/settings", managerPath.ToString()));

            TorrentSettingsAdapter sAdapter = new TorrentSettingsAdapter(settings, settingsPath);
            TorrentManagerAdapter  mAdapter = new TorrentManagerAdapter(manager, tAdapter, sAdapter, managerPath);

            TorrentService.Bus.Register(sAdapter.Path, sAdapter);
            TorrentService.Bus.Register(mAdapter.Path, mAdapter);

            engine.Register(manager);
            downloaders.Add(mAdapter.Path, mAdapter);

            return(mAdapter.Path);
        }
Пример #3
0
        private ObjectPath Load(TorrentAdapter tAdapter, TorrentSettings settings, TorrentManager manager)
        {
            ObjectPath managerPath = new ObjectPath (string.Format (DownloaderPath, downloaderNumber++));
            ObjectPath settingsPath = new ObjectPath (string.Format ("{0}/settings", managerPath.ToString ()));

            TorrentSettingsAdapter sAdapter = new TorrentSettingsAdapter(settings, settingsPath);
            TorrentManagerAdapter mAdapter = new TorrentManagerAdapter(manager, tAdapter, sAdapter, managerPath);

            TorrentService.Bus.Register (sAdapter.Path, sAdapter);
            TorrentService.Bus.Register (mAdapter.Path, mAdapter);

            engine.Register (manager);
            downloaders.Add (mAdapter.Path, mAdapter);

            return mAdapter.Path;
        }