Ejemplo n.º 1
0
        /// <summary>
        /// Removes a torrent from uTorrent
        /// </summary>
        /// <param name="Torrent">The torrent to remove</param>
        /// <param name="RemoveData">Whether or not the data is removed</param>
        public void TorrentRemove(Torrent Torrent, bool RemoveData)
        {
            if (_token == null)
            {
                return;
            }

            try
            {
                if (RemoveData)
                {
                    ServiceClient.RemoveTorrentAndData(Torrent.Hash, _token);
                }
                else
                {
                    ServiceClient.RemoveTorrent(Torrent.Hash, _token);
                }
                GetTorrentsAndLabels(true);
            }
            catch (System.ServiceModel.ProtocolException e)
            {
                // Token possibly expired, get new token.
                Trace.TraceError(e.Message + e.StackTrace);
                GetToken();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes a torrent from uTorrent
 /// </summary>
 /// <param name="Torrent">The torrent to remove</param>
 /// <param name="RemoveData">Whether or not the data is removed</param>
 public void TorrentRemove(Torrent Torrent, bool RemoveData)
 {
     if (RemoveData)
     {
         ServiceClient.RemoveTorrentAndData(Torrent.Hash, _token);
     }
     else
     {
         ServiceClient.RemoveTorrent(Torrent.Hash, _token);
     }
     GetTorrentsAndLabels(true);
 }