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));
        }
示例#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);
        }
示例#4
0
 protected abstract bool CheckAction(UrlAction action);
示例#5
0
 protected override bool CheckAction(UrlAction action)
 {
     return(AuthorizedList.Any(a => a.Equals(action)));
 }
示例#6
0
 protected override bool CheckAction(UrlAction action)
 {
     return(action == UrlAction.AddFile);
 }