JustCode

The Move or Delete Parameter refactoring allows you to quickly change the parameter's position or remove it from the method's signature.

Note

Language Support

Supported: C#, VB.NET

Not supported: JavaScript

Not relevant: ASP.NET, XAML, HTML

To move or delete a parameter

  1. Position the caret over the parameter you want to move or delete.
  2. Press Alt+Insert. From the pop-up menu, select Move Or Delete Parameter...

    Move Or Delete Parameter Select
  3. Press Tab to change the parameter position or Delete to delete the parameter and finish the operation.

    Move Or Delete Parameter Help
  4. Press Enter to move the parameter and finish the operation or Esc to abort the operation.
Note

When you move or delete a parameter, Telerik JustCode also modifies the existing method calls. For more explanations on this see the examples below.

Note

If you move or delete a parameter from a method that implements or overrides another method, Telerik JustCode also modifies the base method. For more explanations on this see the examples below.

Tip

To move or delete a parameter you can also navigate on the main menu. Choose JustCode | Refactor | Move Or Delete Parameter..., or just press Ctrl+R, Ctrl+S

Examples

Original CodeOperationResult
C# Copy imageCopy
public void Foobar(int foo, int bar)
{
}
public void CallFoobar()
{
	Foobar(0, 1);
}

Swap foo and bar parameters positions.
C# Copy imageCopy
public void Foobar(int bar, int foo)
{
}
public void CallFoobar()
{
	Foobar(1, 0);
}

Notice how the call to Foobar() method in CallFoobar() is changed.

C# Copy imageCopy
public class MoveOrDeleteParameters : IFoobar
{
	public void Foobar(int foo, int bar)
	{
	}
}
public interface IFoobar
{
	void Foobar(int foo, int bar);
}

Swap foo and bar parameters positions in the MoveOrDeletePrameters class.
C# Copy imageCopy
public class MoveOrDeleteParameters : IFoobar
{
	public void Foobar(int bar, int foo)
	{
	}
}
public interface IFoobar
{
	void Foobar(int bar, int foo);
}

Notice how the parameters positions are also changed in the IFoobar interface.

See Also