IDocumentFactory.

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

Summary

Clones the specified source document with a new source, 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.Documents
Containing Type
IDocumentFactory

Syntax

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

Parameters

Name Type Description
context IExecutionContext The current execution context.
sourceDocument IDocument The source document.
source FilePath The source (if the source document contains a source, then this is ignored and the source document's source is used instead).
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