IExecutionState Interface
A read-only interface to the IEngine used during an execution.
graph BT Type-.->Interface0["IDocumentFactory"] click Interface0 "/api/Statiq.Common/IDocumentFactory" Type["IExecutionState"] class Type type-node Implementing0["TestExecutionContext"]-.->Type click Implementing0 "/api/Statiq.Testing/TestExecutionContext" Implementing1["TestAnalyzerContext"]-.->Type click Implementing1 "/api/Statiq.Testing/TestAnalyzerContext" Implementing2["TestEngine"]-.->Type click Implementing2 "/api/Statiq.Testing/TestEngine" Implementing3["Engine"]-.->Type click Implementing3 "/api/Statiq.Core/Engine" Implementing4["IEngine"]-.->Type click Implementing4 "/api/Statiq.Common/IEngine" Implementing5["IAnalyzerContext"]-.->Type click Implementing5 "/api/Statiq.Common/IAnalyzerContext" Implementing6["IExecutionContext"]-.->Type click Implementing6 "/api/Statiq.Common/IExecutionContext"

Syntax

public interface IExecutionState : IDocumentFactory

Properties

Name Property Type Summary
ApplicationState IApplicationState
Gets the state of the application when it was run.
CancellationToken CancellationToken
Gets a cancellation token that will be canceled when processing should stop.
ClassCatalog ClassCatalog
A catalog of all classes in all assemblies loaded by the current application context.
Current IExecutionState
The current execution state (which is the IExecutionContext if there is one, and usually the IEngine if not).
static
Events IReadOnlyEventCollection
Gets global events and event handlers.
ExecutingPipelines IReadOnlyPipelineCollection
The pipelines currently being executed.
ExecutionDateTime DateTime
The date/time that the current execution started.
ExecutionId Guid
Uniquely identifies the current execution cycle. This can be used to initialize and/or reset static data for a module on new generations (I.e., due to watching). For example, cache data could be cleared when this changes between runs.
FileSystem IReadOnlyFileSystem
Gets the current file system.
LinkGenerator ILinkGenerator
Helps generate normalized links.
Logger ILogger
MemoryStreamFactory IMemoryStreamFactory
Provides pooled memory streams (via the RecyclableMemoryStream library).
Namespaces INamespacesCollection
Gets a set of namespaces that should be brought into scope for modules that perform dynamic compilation.
OutputPages FilteredDocumentList<IDocument>
Gets the collection of output documents from all previously processed pipelines, filtered to destination paths with a PageFileExtensions extension (which defaults to ".htm" and ".html").
Outputs IPipelineOutputs
Gets the collection of output documents from all previously processed pipelines.
Pipelines IReadOnlyPipelineCollection
Gets the pipelines.
ScriptHelper IScriptHelper
Gets a helper that can compile and evaluate C# scripts.
SerialExecution bool
Indicates that the engine is executing pipeline phases and modules in serial.
Services IServiceProvider
Gets the dependency injection service provider.
Settings IReadOnlySettings
The application configuration as metadata.
Shortcodes IReadOnlyShortcodeCollection
Gets the available shortcodes.

Methods

Name Return Value Summary
CreateHttpClient() HttpClient
Creates a HttpClient instance that should be used for all HTTP communication.
CreateHttpClient(HttpMessageHandler) HttpClient
Creates a new HttpClient instance that uses a custom message handler.
GetContentStream(string) Stream
Gets a Stream that can be used for document content. If content is not null, the stream is initialized with the specified content. It is preferred to use this method to obtain a stream over creating your own if the source of the content does not already provide one. The returned streams are optimized for memory usage and performance. Instances of the returned stream should be disposed when writing is complete.
GetJavaScriptEnginePool(Action<IJavaScriptEngine>, int, int, int, TimeSpan?) IJavaScriptEnginePool
Gets a new IJavaScriptEnginePool. The returned engine pool should be disposed when no longer needed.
SendHttpRequestWithRetryAsync(Func<HttpRequestMessage>, int) Task<HttpResponseMessage>
Sends an HttpRequestMessage with exponential back-off.
SendHttpRequestWithRetryAsync(Func<HttpRequestMessage>) Task<HttpResponseMessage>
Sends an HttpRequestMessage with exponential back-off.

Extension Methods

Name Value Summary
CloneOrCreateDocument(IDocument, IContentProvider) IDocument
CloneOrCreateDocument(IDocument, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
CloneOrCreateDocument(IDocument, NormalizedPath, IContentProvider) IDocument
CloneOrCreateDocument(IDocument, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
CloneOrCreateDocument(IDocument, NormalizedPath, NormalizedPath, IContentProvider) IDocument
CloneOrCreateDocument(IDocument, NormalizedPath, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
CloneOrCreateDocument<TDocument>(TDocument, IContentProvider) TDocument
CloneOrCreateDocument<TDocument>(TDocument, IEnumerable<KeyValuePair<string, object>>, IContentProvider) TDocument
CloneOrCreateDocument<TDocument>(TDocument, NormalizedPath, IContentProvider) TDocument
CloneOrCreateDocument<TDocument>(TDocument, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) TDocument
CloneOrCreateDocument<TDocument>(TDocument, NormalizedPath, NormalizedPath, IContentProvider) TDocument
CloneOrCreateDocument<TDocument>(TDocument, NormalizedPath, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) TDocument
CreateDocument(IContentProvider) IDocument
CreateDocument(IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
CreateDocument(NormalizedPath, IContentProvider) IDocument
CreateDocument(NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
CreateDocument(NormalizedPath, NormalizedPath, IContentProvider) IDocument
CreateDocument<TDocument>(IContentProvider) TDocument
CreateDocument<TDocument>(IEnumerable<KeyValuePair<string, object>>, IContentProvider) TDocument
CreateDocument<TDocument>(NormalizedPath, IContentProvider) TDocument
CreateDocument<TDocument>(NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) TDocument
CreateDocument<TDocument>(NormalizedPath, NormalizedPath, IContentProvider) TDocument
GetCurrentDateTime() DateTime
Gets the current date/time using the CurrentDateTime metadata setting if it's set, otherwise using the value of ExecutionDateTime (which is System.DateTime.Now at the time execution started).
GetLink(IDocument, bool) string
Gets a link for the specified document using the document destination. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(IMetadata, string, bool) string
Gets a link for the specified metadata using the specified metadata value and the default settings from the configuration. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(IMetadata, string, string, bool) string
Gets a link for the specified metadata using the specified metadata value and the default settings from the configuration. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(NormalizedPath, bool) string
Converts the specified path into a string appropriate for use as a link using default settings from the configuration. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(NormalizedPath, string, NormalizedPath, bool, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, NormalizedPath, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, NormalizedPath, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, NormalizedPath, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, string, bool, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, string, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, string, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(NormalizedPath, string, string, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, bool) string
Converts the specified path into a string appropriate for use as a link using default settings from the configuration. This version should be used inside modules to ensure consistent link generation. Note that you can optionally include the host or not depending on if you want to generate host-specific links. By default, the host is not included so that sites work the same on any server including the preview server.
GetLink(string, string, NormalizedPath, bool, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, NormalizedPath, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, NormalizedPath, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, NormalizedPath, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, string, bool, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, string, bool, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, string, bool, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink(string, string, string, bool, bool, bool) string
Converts the path into a string appropriate for use as a link, overriding one or more settings from the configuration.
GetLink() string
Gets a link for the root of the site using the host and root path specified in the settings.
SendHttpRequestWithRetryAsync(string) Task<HttpResponseMessage>
Sends a GET request with exponential back-off.
SendHttpRequestWithRetryAsync(Uri) Task<HttpResponseMessage>
Sends a GET request with exponential back-off.
ThrowIfNull<IExecutionState>(string) T
ToDocument<IExecutionState>(IContentProvider) IDocument
ToDocument<IExecutionState>(IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<IExecutionState>(NormalizedPath, IContentProvider) IDocument
ToDocument<IExecutionState>(NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument
ToDocument<IExecutionState>(NormalizedPath, NormalizedPath, IContentProvider) IDocument
ToDocument<IExecutionState>(NormalizedPath, NormalizedPath, IEnumerable<KeyValuePair<string, object>>, IContentProvider) IDocument