async Task LoadAsync(IRequester requester, Url url, CancellationToken cancel) { var response = await requester.LoadAsync(url).ConfigureAwait(false); if (response != null) { await _doc.LoadAsync(response, cancel); response.Dispose(); } }
async Task LoadAsync(IRequester requester, Url url, CancellationToken cancel) { var response = await requester.LoadAsync(url, _cts.Token).ConfigureAwait(false); if (response != null) { var options = new StyleOptions { Element = this, Title = Title, IsDisabled = IsDisabled, IsAlternate = RelationList.Contains(Keywords.Alternate) }; _sheet = Owner.Options.ParseStyling(response, options, Type); response.Dispose(); } }
/// <summary> /// Loads the given URI by using an asynchronous GET request. /// </summary> /// <param name="requester">The requester to use.</param> /// <param name="url">The url that yields the path to the desired action.</param> /// <returns>The task which will eventually return the response.</returns> public static Task <IResponse> LoadAsync(this IRequester requester, Url url) { return(requester.LoadAsync(url, CancellationToken.None)); }