Export (0) Print
Expand All

How to: Remove Parameters 

Use this procedure to perform the Remove Parameters refactoring operation. For more information, see Remove Parameters.

To remove parameters

  1. Create a console application, and set up the following example.

    For more information, see Console Application Template.

  2. Place the cursor on method A, either in the method declaration or the method call.

  3. From the Refactor menu, select Remove Parameters to display the Remove Parameters Dialog Box.

    You can also type the keyboard shortcut CTRL+R, CTRL+V to display the Remove Parameters Dialog Box.

    You can also right-click the cursor, point to Refactor on the context menu, and then click Remove Parameters to display the Remove Parameters Dialog Box.

  4. Using the Parameters field, place the cursor on int i, then click the Remove button.

  5. Click OK.

  6. In the Preview Changes — Remove Parameters dialog box, click Apply.

Example

To set up this example, create a console application named RemoveParameters, and then replace Class1 with the following code. For more information, see Console Application Template.

    class A
    {
        // Invoke on 'A'.
        public A(string s, int i) { }
    }

    class B
    {
        void C()
        {
            // Invoke on 'A'.
            A a = new A("a", 2);
        }
    }

See Also

Community Additions

ADD
Show:
© 2014 Microsoft