tangible T4 Directives

 

The tangible T4 Editor extends the set of existing T4 Directives that can be used inside T4 Text Template files. This list gives an overview on additional directives that can be used when working with the tangible T4 Editor.

 

The documentation of the basic T4 Text Template Directives is availabl in this MSDN Article.

 

Directive: TangibleUseCaseDiagram

 

Purpose

Allows access to a tangible Use Case Diagram (.tauc) object model from within a T4 template.

 

Syntax

<#@ TangibleUseCaseDiagram processor="TangibleUseCaseDiagramDirectiveProcessor" provides="UseCaseModel"

                           requires="fileName='{relativefile}'" #>

 

Sample

After adding this directive you gain access to the object model of the State Diagram via the StateGraph property.

 


<#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" debug="true" hostSpecific="true" #>

<#@ TangibleUseCaseDiagram processor="TangibleUseCaseDiagramDirectiveProcessor"

                           provides="UseCaseModel"

                           requires="fileName='.\UseCases1.tauc'" #>

<#
    // render all element names of the diagram
    foreach(var element in this.UseCaseModel.UseCaseElements)
    {
#><#= element.Name #>
<#  }
#>