Exemple #1
0
        /// <summary>
        /// Remove selected torrents and downloaded files
        /// </summary>
        private void RemoveTorrentWithData()
        {
            try
            {
                var result = _dialogService.ShowMessageBox(Res.ConfirmTorrentRemovalWithData,
                                                           Res.ApplicationTitle, MessageBoxButton.YesNo);

                if (result == MessageBoxResult.Yes)
                {
                    _torrentService.RemoveTorrentsAsync(SelectedTorrents.Cast <TorrentEntity>().ToList(), true);
                }
            }
            catch (Exception ex)
            {
                _dialogService.ShowMessageBox(ex.ToString());
            }
        }
Exemple #2
0
        /// <summary>
        /// Set the priority of all files in a torrent
        /// </summary>
        /// <param name="param">The parameter.</param>
        private void SetTorrentPriority(string param)
        {
            TorrentPriority priority;

            if (param.Equals(TorrentPriority.Low.ToString()))
            {
                priority = TorrentPriority.Low;
            }
            else if (param.Equals(TorrentPriority.High.ToString()))
            {
                priority = TorrentPriority.High;
            }
            else
            {
                priority = TorrentPriority.Normal;
            }

            _torrentService.SetTorrentPriority(SelectedTorrents.Cast <TorrentEntity>().ToList(), priority);
        }