private HTTPClientResponse ResponseCallback(HTTPClientEventHandler handler, string html, string error) { HTTPClientResponse response = new HTTPClientResponse(); response.raw = html; return(response); }
private void RequestResponseCallback(Object sender, DownloadStringCompletedEventArgs e) { HTTPClientEventHandler handler = e.UserState as HTTPClientEventHandler; handler(ResponseCallback(handler, e.Result, null)); WebClient client = sender as WebClient; client.Dispose(); }
private HTTPClientResponse ResponseCallback(HTTPClientEventHandler handler, string html, string error) { HTTPClientResponse response = new HTTPClientResponse(); response.raw = html; response.html = new HtmlDocument(); response.html.LoadHtml(html); response.node = response.html.DocumentNode; return(response); }
public void RequestGet(string url, HTTPClientEventHandler handler, DownloadStringCompletedEventHandler callback) { if (client.IsBusy) { client.CancelAsync(); } string u = url; client.DownloadStringCompleted -= callback; client.DownloadStringCompleted += callback; client.DownloadStringAsync(new Uri(u), handler); }
public void RequestGetAsync(string url, HTTPClientEventHandler handler) { Instance.RequestGet(url, handler, new DownloadStringCompletedEventHandler(RequestResponseCallback)); }