private Response ActionTorrent(UrlAction urlAction, IEnumerable <string> hashs)
        {
            var request = new Request()
                          .SetAction(urlAction)
                          .IncludeTorrentList(true)
                          .SetTorrentHash(hashs);

            return(ProcessRequest(request));
        }
        private Response ActionTorrent(UrlAction urlAction, string hash)
        {
            Contract.Requires(hash != null);

            var request = new Request()
                          .SetAction(urlAction)
                          .IncludeTorrentList(true)
                          .SetTorrentHash(hash);

            return(ProcessRequest(request));
        }
Esempio n. 3
0
        public BaseRequest <T> SetAction(UrlAction urlAction)
        {
            if (urlAction == null)
            {
                throw new ArgumentNullException("urlAction");
            }

            if (!CheckAction(urlAction))
            {
                throw new InvalidOperationException("urlAction invalide for this request");
            }

            _urlAction = urlAction;
            return(this);
        }
Esempio n. 4
0
 protected abstract bool CheckAction(UrlAction action);
Esempio n. 5
0
 protected override bool CheckAction(UrlAction action)
 {
     return(AuthorizedList.Any(a => a.Equals(action)));
 }
Esempio n. 6
0
 protected override bool CheckAction(UrlAction action)
 {
     return(action == UrlAction.AddFile);
 }