
Chapter 12: Customizing the Development Environment | 357 |
5.In addition to access, the code example in the preceding step includes variables for return, methodName, and paramList. Add Literal elements for each of these variables, where the ID is the variable name and the Default is set to return as void, methodName as MethodName, and paramList as int p1.
6.Save the file and name it meth.snippet. The next section will explain where to put the file, but for now put it in a location that you can remember so you can copy it later. BTW, the Save File dialog box has Snippet Files (*.snippet) for a Save A Type option, which you can use to ensure the snippet has the correct file extension.
You now have a workable snippet. Listing
Listing 12-2 A custom method snippet
<?xml version="1.0"
<Header>
<Title>Method Snippet</Title> <Author>Joe Mayo</Author> <Shortcut>meth</Shortcut> <Description>Create a New Method</Description> <SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>access</ID>
<Default>public</Default> <ToolTip>Access modifier</ToolTip>
</Literal>