I've always known Resharper could improve my productivity but I've just not found the time to invest using it properly yet. I blogged recently about Explore Stack Trace and I'm starting to think of Resharper as an essential piece of kit rather than a nice to have.
However, today I was lucky enough to have my colleague Rupert Benbrook looking over my shoulder whilst I was working on some Prism samples and he's something of a Resharper Ninja and mentored me through some cool features. Here are my favourites so far.
This is really handy for creating Constructors and the like. I particularly like the fact that if I choose Constructor I get to choose which class members should be specified on the constructor.
public class MyClass{private readonly string _foo;public MyClass(string foo) { _foo = foo; }}Nice.
public class MyClass{private readonly string _foo;private readonly IRegionManager _regionManager;public MyClass(string foo, IRegionManager regionManager) { _foo = foo; _regionManager = regionManager; }}Nice!
public class MyClass{private readonly string _foo;private readonly IRegionManager _regionManager;private readonly IUnityContainer _unityContainer;public MyClass(string foo, IRegionManager regionManager, IUnityContainer unityContainer) { _foo = foo; _unityContainer = unityContainer; _regionManager = regionManager; }}Niiiice!
public MyClass(string foo, IRegionManager regionManager, IUnityContainer unityContainer){try { _foo = foo; _unityContainer = unityContainer; _regionManager = regionManager; }catch (Exception exc) { Console.WriteLine(exc); }}Handy.
I'm going to be using Resharper more and more from now on. Let's hope Rupert runs a nice series of Resharper tips on his blog. I'll certainly be watching. Cheers Rupert!
Originally posted by Josh Twist on the 5th of December 2008 here.