Export (0) Print
Expand All
0 out of 3 rated this helpful - Rate this topic

Remove Parameters 

Remove Parameters is a refactoring operation that provides an easy way to remove parameters from methods, indexers, or delegates. Remove Parameters changes the declaration; at any locations where the member is called, the parameter is removed to reflect the new declaration.

You perform the Remove Parameters operation by first positioning the cursor on a method, indexer, or delegate. When the cursor is in position, you can invoke the Remove Parameters operation by selecting it from the Refactor menu, typing the keyboard shortcut, or by selecting the command from a context menu.

When you invoke the Remove Parameters command, the Remove Parameters dialog box appears. For more information, see Remove Parameters Dialog Box or How to: Remove Parameters.

You can remove parameters from a method declaration or a method call. Position the cursor in the method declaration or delegate name and invoke Remove Parameters.

Caution noteCaution

Remove Parameters allows you to remove a parameter that is referenced within the body of the member, but it does not remove the references to that parameter in the method body. This can introduce build errors into your code. However, you can use the Preview Changes Dialog Box to review your code, before executing the refactoring operation.

If a parameter being removed is modified during the call to a method, the removal of the parameter will also remove the modification. For example, if a method call is changed from:

    MyMethod(param1++, param2);

to

    MyMethod(param2);

by the refactoring operation, param1 will not be incremented.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.