|
The predefined variables provided by MZ-Tools to be used in templates are specified below. Note that not all the predefined variables are supported in every kind of template (file header, class header, etc.).
- : the text currently selected in the document. This variable is useful to enclose the selected text with some code above and below. For example, to add an exception handler to a selected code or to enclose it in a region.
- : the prefix that the .NET language of the document uses to comment lines. For example, C# uses the // prefix while VB.NET uses the ' prefix. This variable is useful to create templates with comments that can be used by documents in several .NET languages.
- : the prefix that the .NET language of the document uses for XML comments. For example, C# uses the /// prefix. This variable is useful to create templates with XML comments that can be used by documents in several .NET languages.
- : the user who is adding the template. You can customize in the section of the window whether you want to use the Windows username or a specific username.
- : the name of your company. You can customize its value in the section of the window.
- : this is the value of the attribute specified in the file of the project, and it represents the version of the assembly. In .NET, assemblies have an assembly file version and an assembly version. The assembly file version is the traditional concept of Win32 file version, that is, the version that you should change in each build. The assembly version is a .NET-only concept that allows to do versioning with the assemblies (in the GAC, for example). So, for instance, you can check in the properties window of the System.Windows.Forms.dll assembly of the .NET Framework 1.1 in the GAC that it has an assembly version 1.0.5000.0 while its assembly file version is 1.1.4322.573.
- : this is the value of the attribute specified in the file of the project, and it represents the version of the file of assembly (not to be confused with the version of the assembly). This attribute does not appear always by default in the file but you can add it by hand.
- : the current date. You can customize the format in the section of the window.
- : the current time. The format is always "HH:mm" and can not be customized.
- : this variable is not replaced by an actual value but it allows you to specify where the text cursor (the caret) should be positioned after the template is inserted in the document.
- : the name of the solution (the file name without the extension).
- : the name without path of the file of the solution.
- : the name with path of the file of the solution.
- : the name of the project of the document where the template is being inserted (the file name without the extension).
- : the name without path of the file of the project of the document where the template is being inserted.
- : the name with path of the file of the project of the document where the template is being inserted.
- : the name of the document where the template is being inserted (the file name without the extension).
- : the name without path of the file of the document where the template is being inserted.
- : the name with path of the file of the document where the template is being inserted.
- : the kind of the file. For example, "Form", "UserControl", "Code", etc.
- : the full name of the namespace where the template is being inserted. For example, "MyNamespace1.MyNamespace2".
- : the name of the namespace where the template is being inserted.
- : the root namespace that is set in the properties page of a VB.NET project. On the contrary to C#, this namespace is used even if no namespace is declared explicitly in the source code.
- : the full name of the class where the template is being inserted. For example, "MyNamespace.MyClass".
- : the name of the class where the template is being inserted.
- : the description of the class where the template is being inserted. Although the term "class" is used in some features of MZ-Tools, actually it can be a struct or a module (VB.NET). This variable returns a localized description for the kind of "class".
- : the keyword for the kind of the class where the template is being inserted. Although the term "class" is used in some features of MZ-Tools, actually it can be a struct or a module (VB.NET). This variable returns the keyword used by the .NET language of the document for the kind of "class". For example, in the case of "classes" of the kind struct, the keyword can be "struct" for C#, "Structure" for VB.NET, etc.
- : the full name of the procedure where the template is being inserted. For example, "MyNamespace.MyClass.MyProcedure".
- : the name of the procedure where the template is being inserted.
- : the body of the procedure where the template is being inserted. This variable is useful to insert custom code at the start / end of a procedure.
- : a localized description of the kind of procedure where the template is being inserted. For example, "Function", "Subroutine", etc.
- : the keyword for the kind of the procedure where the template is being inserted. For example, "Sub", "Function", etc.
- : the keyword for the list of handled events (after the "Handles" clause of the procedure declaration).
- : the name of the type that the procedure returns, using the .NET Framework name. For example, "Int32".
- : the full name of the type that the procedure returns. For example, "System.Int32".
- : the alias in the .NET language of the document for the type that the procedure returns. For example, "int" in the case of C# or "Integer" in the case of VB.NET.
- : the prefix defined in the Nomenclature section of the Corporate Options window for the type that the procedure returns.
- : delimiter of the begin of the section that will be repeated for each parameter.
- : delimiter of the end of the section that will be repeated for each parameter. It is used along with the previous one.
- : the names of the parameters of the procedure. One line is generated for each parameter unless the and predefined variables are used.
- : the name of the type of the parameter, using the .NET Framework name. For example, "Int32".
- : the full name of the type of the parameter. For example, "System.Int32".
- : the alias in the .NET language of the document for the type of the parameter. For example, "int" in the case of C# or "Integer" in the case of VB.NET.
- : the modifiers of the parameter. For example, "ref", "out", etc. for C# or "ByVal", "ByRef", "Optional", etc. for VB.NET.
- : since normally one line is generated for each parameter of the procedure this variable allows you to align the descriptions of the parameters after the names.
- : the comma character "," if the parameter is not the last one, or the empty character "" if it is the last one. This variable is typically used to build a comma-separated list of parameters in a single line.
- : the space character " " if the parameter is not the last one, or the empty character "" if it is the last one. This variable is typically used to build a comma-separated list of parameters in a single line.
The Replace Text feature of MZ-Tools allows you to use the following predefined variables. This can be useful in composing the replacement text:
- : the text that has been found according to the search criteria.
- : the whole line where the text has been found.
- : the text in the line before the found text.
- : the text in the line after the found text.
See Also:
Template Properties
Review Properties
Find / Replace Text
|