Finally we got an improved VS' Step Into feature. But what is wrong with actual one? Let's see an example:
public static void Main()
private void SomeMethod(bool flag, int value)
private bool SomeField
bool result = ...
private int GetSomeValue()
Imagine you are positioned before SomeMethod gets invoked and you want to step into SomeMethod directly. Untill now you've got an annoyance here. The only option was to set a breakpoint at the beginning of SomeMethod and Step Over or run the code and wait for breakpoint being hit.
If you instead choose Step Into then you would step into each of the parameters being passed before stepping into SomeMethod, in my case a property and another method. Highly annoying.
OK, there is also a DebuggerStepThrough attribute which you can apply at design time to a property or to a method. At the runtime the debugger won't step into methods or properties decorated with this attribute. But this option is very rigid as you have to decide at design time and you can't change it during execution. Plus it requires source code modifications.
So people have been waiting for direct step into (or whatever you want to call it) since the beginning of VS creation. No luck so far, [MS] apparently didn't hear on this ear. Instead, fine [DevEx] folks decided to implement it by themselves and put the feature into the latest incarnation of CodeRush. Yes, by installing CodeRush 2.1.1 or newer you get direct step into through the Shift-Ctrl+F11 (configurable) shortcut. No more ad-hoc breakpoints, no more countless hours of stepping into just to get into the right method - hit Shift+Ctrl+F11 and there you go directly into the method you want.
If you are still undecided whether to install CodeRush or not, this is a perfect reason to install it. Besides this handy feature there is a lot, lot more that CodeRush brings you.
[DevEx] XtraLayoutControl sets its items default Padding to 5;5;5;5 (left, right, top, bottom) which might not be always desired value and there is no easy way to alter this default setting as per this support center entry.
However, there is a solution that is fairly easy to implement. Just derive a class from XtraLayoutControl and override CreateLayoutItem method as shown in this piece of code:
public class RhLayoutControl: LayoutControl
public override BaseLayoutItem CreateLayoutItem(LayoutGroup parent)
BaseLayoutItem item = base.CreateLayoutItem(parent);
item.Padding = new Padding(5, 5, 2, 2);
Here I set default Padding for an item to (5, 5, 2, 2) but you can set is as you wish. Of course, instead of XtraLayoutControl you would have to use RhLayoutControl to make this trick work.
After installing VS 2005 SP1 beta I noticed that all 3rd party icons disappeared from toolbox. Apparently SP1 beta looses icons on install. The situation is more annoying with [DevEx] components because setup won't repair the situation nor will uninstall/install help (Note: I didn't check much other vendor's components, I just noticed that telerik asp.net stuff is installed correctly). Obviously SP1 beta changed something in toolbox entry install process and installer for [DevEx] stuff doesn't work correctly. You can still create all those entries manually but this process is rather tedious.
The good news is [DevEx] folks already fixed the problem. All you need to do is to download improved ToolBoxCreator tool (a tool that ships with their stuff) that you'll find here and run it. Simple as that.
- Ctrl+3 aka embed method in region with the name of method
- Auto Completition aka completes the word you are typing and mostly the suggestion is correct.
- Introduce local aka extracts an expression and assign it to a variable.
- Templates aka CR writes code blocks for you.
- Moving within an identifier aka jumping between different casing instead of whole word.
And these are only most used features right out my head. There are tons of other excellent features worth exploring.
You might also check my DXCore plugins here and here.
It contains new ASP.NET controls; ASPxMenu, ASPxNavBar, ASPxTabControl, ASPxSiteMapcontrol and of course, full support for AJAX. Then there is a RibbonControl, XtraCharts has new graphs (3D ones among them), VisualStudio type docking, XtraGrid got an advanced filter, new WinForms controls (MarqueeProgressBar, TrackBarControl, LabelControl, XtraScrollableControl), XtraForm supports skinning of entire outlook plus other improvements and fixes. If you are a subscriber, go to client area and download them. If you aren't, go to [DevEx] site and look for trial download - worth checking out.
CodeRush made a major version jump to 2.0.1. Apparently the most of the improvements are template related which makes sense as templates are huge productivity booster. Check new training videos here:
If you are not yet using CodeRush then you are missing a lot in working with Visual Studio 200x. This tool is a must have for a serious developer. Now you know.
These days I’ve came across this situation – related to [DevEx]' XPO:
This piece of code creates an instance of generic XPCollection that deals with Customer list. Next I set the condition to use for data retrieval and at the end I say that it is OK to load the data (note that XPCollection does lazy load). However it won’t work like that. Second line will throw an exception: can't reload collection with disabled loading. The solution is quite simple but perhaps it won’t work always for you - just switch second and third row to get code like this:
If you ignore the fact that it doesn’t allow you setting the condition before loading (unless you do it in constructor), which I struggle to understand why, you’ll see another issue. The guidelines for creating properties say something like (out of my memory):
It shouldn’t matter the order of setting properties
Properties shouldn’t perform any actions and should return the same value when called multiple times in a row
Clearly the way that XPCollection works is against first rule but not against second rule as one would assume from the exception text as it really doesn’t perform any action when setting Criteria – it just throws an exception if LoadingEnabled is disabled. I hope that this behavior will change in the future as it is against guidelines and it doesn’t allow you to construct Criteria before loading is enabled.
Yesterday I had a repeat of my whole day presentation "What's new in Visual Studio 2005/.net 2" and the audience was great. Note: you can find the slides here. I was asked few questions which I promised to answer later because I didn't know them on the spot (yes, yes, I know). So, here is the first question answered:
Why is R! (both free refactor that comes with VB.NET and R! Pro) allowing Introduce Local (Replace All) operation on Double.Parse(TextBox1.Text) in the following situation:
After the Introduce Local (Replace All) operation we get this result, which is obviously faulty because the value should be different for d and c variables.
So, the question was whether this is a bug or by design (by design I mean: do this operation on your own risk)?
The answer is quite logical and simple: it is a bug and R! guys are woking on to fix it.
Imagine a class with lot of fields.
Now, you would want to build a constructor that initializes all or many of the fields by assigning arguments to coresponding fields so you don't need to initialize all fields one by one, plus you have the guarantee that all fields are initialized. Makes sense, right. Now, how would you write such a constructor? You might just use all of your 20 fingers and type it. Pretty annoying, isn't it. Afterall all the information is already there.
So, meet one of the CodeRush's feature I love: Smart Constructor. Just move the caret to the point where you want your constuctor created and type cc [SPACE] (assuming default CodeRush settings). A window like this will appear:
You can uncheck fields at will. After you are done just press [ENTER].
Isn't this feature just lovely? CodeRush just sucks the metadata from the declaration and creates a constructor with all arguments you've selected. It certainly saves a lot of annoying typing for me and prevents me to type wrong assignments. And this is just one of the million CodeRush's features.