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