HtmlResourceSession
OfficeIMO.Html
Operation-scoped owner for HTML resource policy, resolution, MIME validation, deduplication, caching, budgets, timeouts, cancellation evidence, canonical identities, and content digests.
Inheritance
- object
- HtmlResourceSession
Usage
Explore 2 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 2
Constructors
public HtmlResourceSession(HtmlUrlPolicy? resourcePolicy = null, HtmlRenderResourceResolver? resolver = null, TimeSpan? resourceTimeout = null, int maxConcurrentLoads = 8, long maxResourceBytes = 10485760, long maxTotalResourceBytes = 52428800, int maxResourceCount = 256, int maxResourceRequests = 512, int maxStylesheetImportDepth = 16) #Creates an independent resource session.
Parameters
- resourcePolicy OfficeIMO.Html.HtmlUrlPolicy? = null
- resolver OfficeIMO.Html.HtmlRenderResourceResolver? = null
- resourceTimeout System.TimeSpan? = null
- maxConcurrentLoads int = 8
- maxResourceBytes long = 10485760
- maxTotalResourceBytes long = 52428800
- maxResourceCount int = 256
- maxResourceRequests int = 512
- maxStylesheetImportDepth int = 16
Methods
public static HtmlResourceSession Resolve(HtmlResourceManifest manifest, HtmlRenderOptions options, HtmlDiagnosticReport? diagnostics = null, CancellationToken cancellationToken = default) #Resolves a manifest synchronously using the configured synchronous package resolver, when present.
Parameters
- manifest OfficeIMO.Html.HtmlResourceManifest
- options OfficeIMO.Html.HtmlRenderOptions
- diagnostics OfficeIMO.Html.HtmlDiagnosticReport? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
HtmlResourceSessionpublic static Task<HtmlResourceSession> ResolveAsync(HtmlResourceManifest manifest, HtmlRenderOptions options, HtmlDiagnosticReport? diagnostics = null, CancellationToken cancellationToken = default) #Resolves a manifest asynchronously using one operation-scoped session.
Parameters
- manifest OfficeIMO.Html.HtmlResourceManifest
- options OfficeIMO.Html.HtmlRenderOptions
- diagnostics OfficeIMO.Html.HtmlDiagnosticReport? = null
- cancellationToken System.Threading.CancellationToken = default
Returns
Task<HtmlResourceSession>public bool TryGet(string? source, string? resolvedSource, out HtmlResolvedResource resource) #Gets a cached resource by original or canonical source.
Parameters
- source string?
- resolvedSource string?
- resource OfficeIMO.Html.HtmlResolvedResource
Returns
boolInherited Methods
Properties
public HtmlUrlPolicy ResourcePolicy { get; } #Resource URL policy snapshot owned by this operation.
public HtmlRenderResourceResolver? Resolver { get; } #Asynchronous application resolver snapshot owned by this operation.
public TimeSpan ResourceTimeout { get; } #Deadline after which one resolver invocation's cancellation token is cancelled.
public int MaxConcurrentLoads { get; } #Maximum concurrent asynchronous resolver invocations.
public long MaxResourceBytes { get; } #Maximum accepted bytes for one resource.
public long MaxTotalResourceBytes { get; } #Maximum accepted bytes for the operation.
public int MaxResourceCount { get; } #Maximum accepted resource count.
public int MaxResourceRequests { get; } #Maximum attempted resolver requests.
public int MaxStylesheetImportDepth { get; } #Maximum external stylesheet import depth.
public HtmlDiagnosticReport Diagnostics { get; } #Diagnostics emitted by this session.
public IReadOnlyList<HtmlResourceSessionEntry> Resources { get; } #Accepted canonical resources in acceptance order.
public long AcceptedResourceBytes { get; private set; } #Total accepted encoded bytes.
public int AcceptedResourceCount { get; private set; } #Number of accepted deduplicated resources.
public int ResolverRequestCount { get; } #Number of resolver requests reserved by the session.
public long DecodedFontBytes { get; private set; } #Accepted decoded font bytes retained by the operation, including nested documents and installed fallback faces. Encoded resource bytes remain separate.