# MhtmlRemoteResourcePolicy

Explicit policy for resources absent from an MHTML archive and delegated to a caller resolver.

Class 

`OfficeIMO.Mhtml`

**Namespace**

`OfficeIMO.Mhtml`

**Assembly**

`OfficeIMO.Mhtml`

**Source revision**

`3b680b1b6fb1` with working tree changes

**Source**

[MhtmlRemoteResourcePolicy.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L10)

**Modifiers**

sealed

Explicit policy for resources absent from an MHTML archive and delegated to a caller resolver. Embedded MIME resources are not network resources and remain governed by the shared HTML byte/count limits.

## Inheritance

- object
- MhtmlRemoteResourcePolicy

## Usage

Explore 3 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

- Method [MhtmlRemoteResourcePolicy.CreateEmbeddedOnlyProfile](/api/mhtml/officeimo-mhtml-mhtmlremoteresourcepolicy/#method-createembeddedonlyprofile)
- Method [MhtmlRemoteResourcePolicy.CreateSameOriginProfile](/api/mhtml/officeimo-mhtml-mhtmlremoteresourcepolicy/#method-createsameoriginprofile-int32)

### Accepted by parameters 1

- Method [MhtmlDocument.ConfigureRenderOptions](/api/mhtml/officeimo-mhtml-mhtmldocument/#method-configurerenderoptions-officeimo-html-htmlrenderoptions-officeimo-mhtml-mhtmlremoteresourcepolicy) parameter `remoteResourcePolicy`

Filter members 

Show inherited

## Constructors

`public MhtmlRemoteResourcePolicy()` [#](#constructor-ctor)

[MhtmlRemoteResourcePolicy.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L10)

## Methods

`public static MhtmlRemoteResourcePolicy CreateEmbeddedOnlyProfile()` [#](#method-createembeddedonlyprofile)

[MhtmlRemoteResourcePolicy.cs:13](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L13)

Creates the default offline profile. No remote fallback resolver is invoked.

Returns

`MhtmlRemoteResourcePolicy`

`public static MhtmlRemoteResourcePolicy CreateSameOriginProfile(int maximumRedirects = 3)` [#](#method-createsameoriginprofile-int32)

[MhtmlRemoteResourcePolicy.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L20)

Creates a bounded same-origin remote profile. Additional origins can be added through [MhtmlRemoteResourcePolicy.AllowedOrigins](/api/mhtml/officeimo-mhtml-mhtmlremoteresourcepolicy/) using absolute HTTP or HTTPS origins.

Parameters

**maximumRedirects int = 3 optional**

Returns

`MhtmlRemoteResourcePolicy`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public bool AllowRemoteResources { get; set; }` [#](#property-allowremoteresources)

[MhtmlRemoteResourcePolicy.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L27)

Whether a caller-supplied resolver may be invoked for HTTP or HTTPS resources.

`public bool AllowSameOrigin { get; set; }` [#](#property-allowsameorigin)

[MhtmlRemoteResourcePolicy.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L30)

Whether the archive root origin is allowed. Defaults to false in the offline profile.

`public int MaximumRedirects { get; set; }` [#](#property-maximumredirects)

[MhtmlRemoteResourcePolicy.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L33)

Maximum redirects a resolver may follow. Defaults to zero.

`public MhtmlRemoteResourceFetcher? ResourceFetcher { get; set; }` [#](#property-resourcefetcher)

[MhtmlRemoteResourcePolicy.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L39)

Optional one-hop remote fetcher. It must return redirects without following them; OfficeIMO validates each next URI before invoking the fetcher again.

`public ISet<string> AllowedOrigins { get; }` [#](#property-allowedorigins)

[MhtmlRemoteResourcePolicy.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L42)

Additional allowed origins, expressed as absolute HTTP or HTTPS URI strings.

`public long MaximumResourceBytes { get; set; }` [#](#property-maximumresourcebytes)

[MhtmlRemoteResourcePolicy.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L45)

Maximum bytes accepted from one resource while remote fallback is enabled.

`public long MaximumTotalResourceBytes { get; set; }` [#](#property-maximumtotalresourcebytes)

[MhtmlRemoteResourcePolicy.cs:48](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L48)

Maximum total resource bytes accepted during one render while remote fallback is enabled.

`public int MaximumResourceCount { get; set; }` [#](#property-maximumresourcecount)

[MhtmlRemoteResourcePolicy.cs:51](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L51)

Maximum resources accepted during one render while remote fallback is enabled.

`public int MaximumResourceRequests { get; set; }` [#](#property-maximumresourcerequests)

[MhtmlRemoteResourcePolicy.cs:54](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L54)

Maximum resolver invocations attempted during one render while remote fallback is enabled.

`public TimeSpan ResourceTimeout { get; set; }` [#](#property-resourcetimeout)

[MhtmlRemoteResourcePolicy.cs:57](https://github.com/EvotecIT/OfficeIMO/blob/3b680b1b6fb15a268ff5525a4ca6cdd70b2f6613/OfficeIMO.Mhtml/MhtmlRemoteResourcePolicy.cs#L57)

Maximum duration of one resolver invocation while remote fallback is enabled.

<!-- PowerForge markdown artifact sha256:5535BA8F568A574AFD0E8E9F2051AA889DD56F33ACE9793909D0997042739601 -->
