.NET Blog

Tony Cavaliere

 
My Favourite Albums
  And the Grappa wins.
E-mail me Send mail
Add to Technorati Favorites AddThis Feed Button

Subscribe to Cynot Why Not


Recent posts

Disclaimer

Hey unlike other bloggers I stand by what I say but just in case. The opinions expressed herein are my own except on Tuesday when the second card is not turned up otherwise it ain't worth squat.

© Copyright 2010

Increasing Productivity: Add Reflector as an External Tool

You have just built an assembly in Visual Studio and want to look at it using a tool like Lutz Roeder's Reflector. So what do you do? You start reflector, go to the  File->Open menu option and navigate to the directory containing the assembly. Sound familiar? Wouldn't it be great if it was possible to start reflector from within the IDE and automatically load the assembly? Well you can using the External Tools feature from within Visual Studio.

Here are the steps:

1. Navigate to the Tools menu and select External Tools. The External Tools dialog will appear.

VSIDE Exteranl Tools Dialog

2. Enter a title (the character after ampersand will become the ALT key), command (location of reflector executable) and arguments ($(ItemPath) is the file currently selected in the solution explorer). In the above, I setup the title to be &Reflector which means the hot key will be Alt R.

That's it you are done. Now whenever you want to reflect, select the assembly in the solution explorer, select Tools menu item, and then select the newly created menu item for reflector. Alternatively you can use the hotkey Alt T + Alt R (assuming you setup the hot key as per step 2).

Happy Reflecting!

Guess the Movie

There are two kinds of spurs, my friend. Those that come in by the door,  those that come in by the window.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: .NET
Posted by CynotWhyNot on Tuesday, March 18, 2008 2:00 PM
Permalink | Comments (12) | Post RSSRSS comment feed

Binding to an array of String: Where's my String?

This one has bothered me for some time. Here is the situation you have a simple array of strings and then you bind it to a DataGrid. What do you expect when the grid is rendered? Silly me I was expecting to see a bunch of strings. And what did I get, a grid with a single column containing a heading of Length and a list of values that represents the length of each string in the array.

What the heck is happening here?

Here is a code snippet that declares an array of String that is later bound to a DataGrid.


  Dim s As String() = {"hey", "man", "where's", "my", "string"}

  DataGridView1.DataSource = s.ToList


The DataGrid is displayed as

Where is my String DataGrid

So where are the strings? Behind the covers .NET is using reflection to inspect the String object and searches for all properties that have no parameters. Each of these properties is then displayed in the DataGrid; and you guessed it the only parameter-less property the String object exposes is Length.

Guess the movie

Hey, what do you like, the leg or the wing, Henry? Or do you still go for the old hearts and lungs?

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: VB.NET
Posted by CynotWhyNot on Monday, March 17, 2008 1:46 PM
Permalink | Comments (71) | Post RSSRSS comment feed