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: TangiblePersistentObjectDiagram

 

Purpose

Allows access to a tangible Persistent Object Diagram (.tasl) object model from within a T4 template.

 

Syntax

<#@ TangiblePersistentObjectDiagram processor="TangiblePersistentObjectDiagramDirectiveProcessor" provides="PersistentObjectModel"

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

 

Sample

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

 


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

<#@ TangiblePersistentObjectDiagram processor="TangiblePersistentObjectDiagramDirectiveProcessor"

                                    provides="PersistentObjectModel"

                                    requires="fileName='.\tasl1.tasl'" #>

<#
    // display all object names
    foreach(var po in this.PersistentObjectModel.PersistentObjects)
    {
#><#= po.Name #>
<#  }

#>