ITemplateEngineHost Interface

Definition

Gets host-specific properties, loggers and provides access to file system.

C#
public interface ITemplateEngineHost
C#
public interface ITemplateEngineHost : IDisposable
Derived
Implements

Properties

BuiltInComponents

Gets the list of built-in components provided by the host.

FallbackHostTemplateConfigNames

Gets the fallback names that will be probed to locate the host specific template settings file. The primary host template config name is HostIdentifier.

FileSystem

Provides access to file system. Depending on the settings, the file system can be physical or in-memory or both depending on the file path. To virtualize certain file path, use VirtualizeDirectory(String).

HostIdentifier

Gets the identifier of the host.

Logger

Gets default logger for given template engine host.

LoggerFactory

Gets logger factory for given template engine host.

Version

Gets the version of the host.

Methods

LogDiagnosticMessage(String, String, String[])
LogMessage(String)
LogTiming(String, TimeSpan, Int32)
OnConfirmPartialMatch(String)
OnCriticalError(String, String, String, Int64)
OnNonCriticalError(String, String, String, Int64)
OnParameterError(ITemplateParameter, String, String, String)
OnPotentiallyDestructiveChangesDetected(IReadOnlyList<IFileChange>, IReadOnlyList<IFileChange>)
Obsolete.

Action to be done when potentially destructive changes on template instantiation are detected. The host can implement it as needed: prompt user, show error, etc. In case template instantiation should proceed, the method should return true. In case template instantiation should be aborted, the method should return false.

OnSymbolUsed(String, Object)
TryGetHostParamDefault(String, String)

Tries to get default host parameter by its name.

VirtualizeDirectory(String)

Virtualizes access to the path. After the location is virtualized, the file read/writes will be done from/to memory instead of physical file system. All subfolders in the location will be also virtualized.

Applies to

Produkt Verzie
Template Engine 6.0.100, 7.0.100