CustomDocumentFactory<T>.

GetDocument(IExecutionContext, 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.Core.dll
Namespace
Wyam.Core.Documents
Containing Type
CustomDocumentFactory<T>

Syntax

public IDocument GetDocument(IExecutionContext context, IDocument sourceDocument, 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.
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