Refactoring C# Code in Whidbey
Want to refactor some code? How do we do it today, maybe use global find and replace? Ugly.
Whidbey has several great new tools to select a block of code, right click and select one of about 8 ways to refactor your code. My personal favorite is “Extract Method” where Whidbey takes selected code and makes it a new method (complete with parameters). Whidbey then writes a line of code where the code use to exist calling your new method.
Some other refactoring tools allow you to promote a variable to a parameter, switch the order, etc of parameters and also “surround with” which allows you to surround your code in an If statement, Try block, etc.
Happy Refactoring.
(From TLS321: Visual C# "Whidbey" IDE Enhancements)
Page rendered at Thursday, March 30, 2023 10:06:30 AM (Eastern Standard Time, UTC-05:00)
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.