/// <summary>
 /// Builds a new CSSStyleSheet asynchronously by requesting the given URL.
 /// </summary>
 /// <param name="configuration">Options to use for the document generation.</param>
 /// <param name="url">The URL which points to the address containing the source code.</param>
 /// <returns>The task which constructs the CSS stylesheet.</returns>
 public static Task <ICssStyleSheet> ParseCssAsync(this IConfiguration configuration, Uri url)
 {
     return(DocumentBuilder.CssAsync(url, configuration));
 }
Esempio n. 2
0
 /// <summary>
 /// Uses the URL to download the content asynchronously, parse it as CSS and returning
 /// a new CSSStyleSheet with the CSS-OM representation.
 /// </summary>
 /// <param name="uri">The source of the CSS content.</param>
 /// <param name="cancel">The cancellation token for aborting the download.</param>
 /// <param name="configuration">[Optional] Custom options to use for the document generation.</param>
 /// <returns>The CSS stylesheet.</returns>
 public static Task <ICssStyleSheet> GetCssAsync(this Uri uri, CancellationToken cancel, IConfiguration configuration = null)
 {
     return(DocumentBuilder.CssAsync(uri, cancel, configuration));
 }
 /// <summary>
 /// Builds a new CSSStyleSheet asynchronously by requesting the given (network) stream.
 /// </summary>
 /// <param name="configuration">Options to use for the document generation.</param>
 /// <param name="stream">The stream of chars to use as source code.</param>
 /// <param name="url">[Optional] The base URL of the document.</param>
 /// <returns>The task which constructs the CSS stylesheet.</returns>
 public static Task <ICssStyleSheet> ParseCssAsync(this IConfiguration configuration, Stream stream, String url = null)
 {
     return(DocumentBuilder.CssAsync(stream, configuration, url));
 }