Professional Documents
Culture Documents
http://msdn.microsoft.com/en-us/library/5ss5z206
Note
You cannot reorder the first parameter in an extension method.
To reorder parameters
1. Create a class library named ReorderParameters, and then replace Class1 with the following example code.
class ProtoClassA { // Invoke on 'MethodB'. public void MethodB(int i, bool b) { } } class ProtoClassC { void D() { ProtoClassA MyClassA = new ProtoClassA(); // Invoke on 'MethodB'. MyClassA.MethodB(0, false);
2. Place the cursor on MethodB, either in the method declaration or the method call. 3. On the Refactor menu, click Reorder Parameters. The Reorder Parameters dialog box appears. 4. In the Reorder Parameters dialog box, select int i in the Parameters list, and then click the down button. Alternatively, you can drag int i after bool b in the Parameters list. 5. In the Reorder Parameters dialog box, click OK. If the Preview reference changes option is selected in the Reorder Parameters dialog box, the Preview Changes - Reorder Parameters dialog box will appear. It provides a preview of
1 of 2
5/25/2012 11:37 AM
http://msdn.microsoft.com/en-us/library/5ss5z206
the changes in the parameter list for MethodB in both the signature and the method call. a. If the Preview Changes - Reorder Parameters dialog box appears, click Apply. In this example, the method declaration and all the method call sites for MethodB are updated.
Remarks
You can reorder parameters from a method declaration or a method call. Position the cursor on or next to the method or delegate declaration but not in the body.
See Also
Concepts Refactoring (C#)
Yes
No
Community Content
2012 Microsoft. All rights reserved.
2 of 2
5/25/2012 11:37 AM