DirectiveProcessor.Initialize Method
When overridden in a derived class, initializes the processor instance.
Namespace: Microsoft.VisualStudio.TextTemplating
Assembly: Microsoft.VisualStudio.TextTemplating.11.0 (in Microsoft.VisualStudio.TextTemplating.11.0.dll)
Syntax
'Declaration
Public Overridable Sub Initialize ( _
host As ITextTemplatingEngineHost _
)
public virtual void Initialize(
ITextTemplatingEngineHost host
)
public:
virtual void Initialize(
ITextTemplatingEngineHost^ host
)
abstract Initialize :
host:ITextTemplatingEngineHost -> unit
override Initialize :
host:ITextTemplatingEngineHost -> unit
public function Initialize(
host : ITextTemplatingEngineHost
)
Parameters
host
Type: Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHostThe ITextTemplatingEngineHost of the DirectiveProcessor. The DirectiveProcessor can request information about the file system or the external environment from host.
Implements
IDirectiveProcessor.Initialize(ITextTemplatingEngineHost)
Remarks
Initialize is called before StartProcessingRun, and gives the directive processor the opportunity to get information it needs from the host.
You can throw an exception during Initialize to stop the processing.
Examples
The following code example shows a possible implementation for a custom directive processor. This code example is part of a larger example provided for the DirectiveProcessor class.
private int directiveCount;
public override void Initialize(ITextTemplatingEngineHost host)
{
directiveCount = 0;
}
Private directiveCount As Integer
Public Overrides Sub Initialize(ByVal host As ITextTemplatingEngineHost)
directiveCount = 0
End Sub
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualStudio.TextTemplating Namespace
StartProcessingRun
Initialize