TextTransformation Class

The abstract base class for all generated transformation classes. This class also provides utility methods and properties for use in text template code.

Object
  Microsoft.VisualStudio.TextTemplating.TextTransformation
    Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation

Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating.11.0 (in Microsoft.VisualStudio.TextTemplating.11.0.dll)

public abstract class TextTransformation : IDisposable

The TextTransformation type exposes the following members.

  NameDescription
Protected methodTextTransformationInitializes a new instance of the TextTransformation class.
Top

  NameDescription
Public propertyCurrentIndentGets the current indent text, which is prefixed to each line of the generated text output.
Public propertyErrorsInfrastructure. Gets the error collection for the text template transformation process.
Protected propertyGenerationEnvironmentGets or sets the string that the text template transformation process is using to assemble the generated text output.
Public propertySessionGets or sets the current session. A session represents a series of transformations that are executed within the same user command. The session object can be used to transmit information into the code of a text template.
Top

  NameDescription
Public methodClearIndentResets the CurrentIndent to an empty string.
Public methodDispose()Releases all resources used by the TextTransformation.
Protected methodDispose(Boolean)Releases the unmanaged resources used by the TextTransformation and optionally releases the managed resources.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodErrorCreates a new error to store information about errors that occur during the text template transformation process.
Protected methodFinalizeAllows an Object to attempt to free resources and perform other cleanup operations before it is reclaimed by the garbage collector. Called by the garbage collector. (Overrides Object.Finalize.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeInfrastructure. Initializes the TextTransformation class.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPopIndentRemoves the most recently added text from CurrentIndent.
Public methodPushIndentAdds text to CurrentIndent, which is prefixed to each line of the generated text output.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodTransformTextWhen overridden in a derived class, generates the text output of the transformation.
Public methodWarningCreates a new warning to store information about errors that occur during the text template transformation process.
Public methodWrite(String)Appends a copy of the specified string to the generated text output.
Public methodWrite(String, Object[])Appends a formatted string, which contains zero or more format specifications, to the generated text output. Each format specification is replaced by the string representation of a corresponding object argument.
Public methodWriteLine(String)Appends a copy of the specified string and the default line terminator to the generated text output.
Public methodWriteLine(String, Object[])Appends a formatted string, which contains zero or more format specifications, and the default line terminator, to the generated text output. Each format specification is replaced by the string representation of a corresponding object argument.
Top

The text template transformation process has two steps. In the first step, the text template transformation engine creates a class that is referred to as the generated transformation class. In the second step, the engine compiles and executes the generated transformation class, to produce the generated text output. The generated transformation class inherits from TextTransformation.

Any class specified in an inherits directive in a text template must itself inherit from TextTransformation. TransformText is the only abstract member of this class.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft