The Method Builder
Applies to: Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008
The Method Builder can insert
function (Visual Basic and C#) and sub (only Visual Basic) method templates.
To insert a sub or a function in Visual Basic:
-
Open the Visual Basic code module and click inside
the class or module where you want the new method to be inserted.
-
Click Add New Method on the Code Edit Tools
toolbar or select the same entry in the Code Builder Tools popup menu, Simple
Code Builders secondary popup, to display the Add New Method
dialog-box (quick toolbar
and menu references
are available).
-
Specify the new method name in the corresponding
text box.
-
Select a return
type if you want to create a function
instead of a sub procedure.
-
Optionally, you can specify member arguments.
-
Set the method scope. If you want to use
the implicit public scope then select Do not specify.
-
Set the appropriate modifiers for the new method.
Invalid modifiers are automatically disabled.
-
Generate XML comments: check this option if you want for XML descriptive comments to be generated.
- Press the Standards button in order to review the naming standards configuration (this will be considered when generating code).
- Click Insert/New if you want to generate and insert the new method and continue with another one. Use Insert to simply close the dialog after
the new method is generated and inserted in code.
To insert a function in C#:
-
Open the C# code module and click inside the class
where you want the new method to be inserted.
-
Click Add New Method on the Code Edit Tools
toolbar or select the same entry in the Code Builder Tools popup menu, Simple
Code Builders secondary popup, to display the Add New Method
dialog-box (quick toolbar
and menu references
are available).
-
Specify the new method name in the corresponding
text box.
-
Select a standard type or specify a new return
data type for the new function.
-
Optionally, you can specify the method's arguments.
You can also set these arguments after you have inserted
the method template in the Code window.
-
Set the method's scope. If you want to use
the implicit public scope then select the Do not specify
option.
-
Set the appropriate modifiers for the new method.
Invalid modifiers are automatically disabled.
-
Generate XML comments: check this option if you want for XML descriptive comments to be generated.
- Press the Standards button in order to review the naming standards configuration (this will be considered when generating code).
- Click Insert/New if you want to generate and insert the new method and continue with another one. Use Insert to simply close the dialog after
the new method is generated and inserted in code.
Note
-
New methods can also be created by using the Add New
method entry from the CodeSMART Code Explorer
context menu. This entry is available for module
(Visual Basic) and class type nodes only.
See Also
Back to top
|