Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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);



by the refactoring operation, param1 will not be incremented.

Community Additions

© 2015 Microsoft