public TorrentInfoCollection GetTorrentInfo(GalleryToken token) { IAsyncResult asyncResult = this.BeginGetTorrentInfo(token, null); asyncResult.AsyncWaitHandle.WaitOne(); return(this.EndGetTorrentInfo(asyncResult)); }
public bool Equals(GalleryToken obj) { if ((object)obj == null) return false; return (this.gid == obj.gid) && (this.token == obj.token); }
public TorrentInfoCollection EndGetTorrentInfo(IAsyncResult asyncResult) { ApiResult aRes = asyncResult as ApiResult; if (aRes == null || aRes.m_parentId != ExHentai.KeyTorrentInfo) { throw new FormatException(); } if (aRes.m_exception != null) { throw aRes.m_exception; } aRes.CompletedSynchronously = true; GalleryToken token = aRes.m_userState as GalleryToken; if (token == null) { return(new TorrentInfoCollection(aRes.m_body)); } else { return(new TorrentInfoCollection(aRes.m_body, token)); } }
public bool Equals(GalleryToken obj) { if ((object)obj == null) { return(false); } return((this.gid == obj.gid) && (this.token == obj.token)); }
public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack, object userState) { WebRequest wReq = WebRequest.Create(String.Format("http://exhentai.org/gallerytorrents.php?gid={0}&t={1}", token.gid, token.token)); wReq.Proxy = this.Proxy; wReq.Method = "GET"; wReq.Headers.Set("cookie", this.m_cookie); return(new ApiResult(wReq, ExHentai.KeyTorrentInfo, callBack, userState)); }
internal TorrentInfo(string body, GalleryToken token) { this.Token = token; this.gtid = int.Parse(rGtid.Match(body).Groups[1].Value); this.PostedUTC = DateTime.Parse(rPosted.Match(body).Groups[1].Value); this.Posted = this.PostedUTC.ToLocalTime(); this.Size = parseSize(rSize.Match(body).Groups[1].Value.Trim()); this.Seeds = int.Parse(rSeeds.Match(body).Groups[1].Value.Trim()); this.Peers = int.Parse(rPeers.Match(body).Groups[1].Value.Trim()); this.Downloads = int.Parse(rDownload.Match(body).Groups[1].Value.Trim()); this.Uploader = rUPloader.Match(body).Groups[1].Value.Trim(); this.FileName = rName.Match(body).Groups[1].Value.Trim(); }
internal TorrentInfoCollection(string body, GalleryToken token) { this.ShowingStart = this.ShowingEnd = this.SearchCount = 0; string[] arr = rForm.Split(body); for (int i = 0; i < arr.Length; ++i) { try { this.Add(new TorrentInfo(arr[i], token)); } catch { } } }
public override bool Equals(object obj) { if (obj == null) { return(false); } GalleryToken p = obj as GalleryToken; if ((Object)p == null) { return(false); } return((this.gid == p.gid) && (this.token == p.token)); }
public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack, object userState) { WebRequest wReq = WebRequest.Create(String.Format("http://exhentai.org/gallerytorrents.php?gid={0}&t={1}", token.gid, token.token)); wReq.Proxy = this.Proxy; wReq.Method = "GET"; wReq.Headers.Set("cookie", this.m_cookie); return new ApiResult(wReq, ExHentai.KeyTorrentInfo, callBack, userState); }
public TorrentInfoCollection GetTorrentInfo(GalleryToken token) { IAsyncResult asyncResult = this.BeginGetTorrentInfo(token, null); asyncResult.AsyncWaitHandle.WaitOne(); return this.EndGetTorrentInfo(asyncResult); }
public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack, object userState) { return this.BeginGetGalleryInfo(token.ToByteArray(), callBack, userState); }
public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack) { return this.BeginGetTorrentInfo(token, callBack, null); }
public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack) { return this.BeginGetGalleryInfo(token.ToByteArray(), callBack, null); }
public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack) { return(this.BeginGetGalleryInfo(token.ToByteArray(), callBack, null)); }
public IAsyncResult BeginGetGalleryInfo(GalleryToken token, AsyncCallback callBack, object userState) { return(this.BeginGetGalleryInfo(token.ToByteArray(), callBack, userState)); }
public IAsyncResult BeginGetTorrentInfo(GalleryToken token, AsyncCallback callBack) { return(this.BeginGetTorrentInfo(token, callBack, null)); }