IExecutionContext.

GetDocument(IDocument, Stream, IEnumerable<KeyValuePair<string, Object>>, bool) Method

Summary

Clones the specified source document with a new content stream, and additional metadata (all existing metadata is retained) or gets a new document if the source document is null or AsNewDocuments() was called on the module. If disposeStream is true (which it is by default), the provided System.IO.Stream will automatically be disposed when the document is disposed (I.e., the document takes ownership of the System.IO.Stream).
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Execution
Containing Type
IExecutionContext

Syntax

IDocument GetDocument(IDocument sourceDocument, Stream stream, IEnumerable<KeyValuePair<string, Object>> items = null, bool disposeStream = true)

Parameters

Name Type Description
sourceDocument IDocument The source document.
stream Stream The content stream.
items IEnumerable<KeyValuePair<string, Object>> The metadata items.
disposeStream bool If set to true the provided System.IO.Stream is disposed when the document is.

Return Value

Type Description
IDocument The cloned or new document.
GitHub