Code Library Options

Top  Previous  Next

 VS   VB6   VB5   VBA 

The Code Library section of the Team Options tab allows you to maintain the code templates of the team code library (there is also a personal code library in the Personal Options tab), to be used by the Code Library feature:

TeamCodeLibrary

There is a root folder (that cannot be removed or renamed) for each supported language or technology.

You can:

  • Create (nested) folders inside each root folder (with the New Folder... button).
     
  • Create code templates (with the New... button).
     
  • Rename folders (with the Rename... button).
     
  • Delete folders (with the Delete... button).
     
  • Edit code templates (with the Edit... button).
     
  • Delete code templates (with the Delete button).
     
  • Export code templates to a file (with the Export... button), to be imported on another computer, or to move code templates between the team code library and the personal code library.
     
  • Import code templates (with the Import... button), either from a file or from Visual Studio code snippets.

To create a code template you use the following window:

CodeTemplate

In this window you enter the following properties:

  • Description: a text describing the code template.
     
  • Template Text: the actual text of the code template. Using the Insert > button, you can include in the text predefined variables (whose value is assigned automatically by MZ-Tools, such as selected text, name of method, etc.) or user-defined variables (whose value is asked when the code template is inserted).
     
  • Author: the author of the code template.
     
  • Comment: a comment or explanation about the code template.

For Visual Studio:

  • Expansion Keyword (optional): a keyword that you can type in the code and then "expand" it to the whole template text. This can save you time since you avoid the use of the Code Library toolwindow. To expand a keyword to replace it by the actual associated code template text you invoke the MZTools8.ExpandKeyword command provided by MZ-Tools (typically through a keyboard shortcut).
     
  • Command Name (optional): MZ-Tools provides nine commands (MZTools8.CodeTemplate1 ... MZTools8.CodeTemplate9) that you can associate with code templates. When you execute a code template command (typically through a keyboard shortcut, or creating a button on a toolbar from that command), the associated code template text is inserted in the code.

For VB6 / VB5 / VBA:

  • Expansion Keyword (optional): a keyword that you can type in the code and then "expand" it to the whole template text. This can save you time since you avoid the use of the Code Library toolwindow. To expand a keyword to replace it by the actual associated code template text you use the keyboard shortcut that you associate with the Expand Keyword feature in the Keyboard Shortcuts Options:

ExpandKeywordKeyboardShortcut
 

  • Keyboard Shortcut (optional): you can define a keyboard shortcut that, when invoked, the associated code template text is inserted in the code.

See Also:

Code Library

Predefined Variables

User-defined Variables