Thursday, December 23, 2010

Debugging C# Object Initializers, Properties or Operators

When debugging C# in Visual Studio 2008, properties and operators are not debugged by default. To debug properties and operators:

Menu: Tools > Options >> Debugging >> General

Make sure "Step over properties and operators (Managed only)" is unchecked

Also, you can customize a toolbar so that you can easily toggle this option before debugging:

  1. linq - Debugging a C# Object Initializer - Stack Overflow

Sunday, November 21, 2010

DVD/CD Management

If you work with virtual machines, you may have already found how nice it is to load your OS from a .iso file instead of a DVD or CD spinning in a drive. Likewise, installing software like ArcGIS Desktop/Server is much more satisfying when you install from a mounted .iso file. Why is it nice? You have all your .iso files organized on disk, no searching through jewel cases, and the installation is wicked fast.

Install the following software to enable writing un-copyprotected DVD/CDs to an .iso file:

Install the following software to enable mounting of .iso files:
SlySoft Virtual CloneDrive

I realized I wasn't thinking outside the disc.  Unless you have a compelling reason to keep the disc content in .iso format, it makes much more sense to just copy the contents of the disc into a folder.  Then, you can share the folder with your VM to install software.

Tuesday, November 9, 2010

Visual Studio Productivity Tools

My personal preference for a Visual Studio Productivity tool is CodeRush Xpress by Devexpress. It is free which is always a nice feature. I know that ReSharper is also popular, but I found CodeRush Xpress to be a little more intuitive for getting started. There were also some features of Resharper that I found intrusive. CodeRush does a good job of a more subtle integration.

I was just working with a new installation of Visual Studio 2010 and immediately missed some of the helpful features of CodeRush Xpress.  There are some complaints about performance, but I haven't experienced problems myself.

Thursday, November 4, 2010

Visual Studio 2008: Bug in code generator for DataGridView

There is a bug in the Visual Studio 2008 code generator for the DataGridView. If you add a column and set the Name value to "Name", it does it, but next time you compile you will get the following error and warning:

  • Error 1 Cannot implicitly convert type 'string' to 'System.Windows.Forms.DataGridViewTextBoxColumn'
  • Warning 2 'LccEditor.Form1.Name' hides inherited member 'System.Windows.Forms.Control.Name'. Use the new keyword if hiding was intended.

The solution? Name the column something else!

Tuesday, November 2, 2010

ArcGIS 10 Desktop: Edit Custom Geoprocessing Tool Description (Documentation)

You can edit the description for custom toolbox tools (or even ESRI's tools) in ArcGIS Desktop 10 by making the following registry entry:



You can see in the image that the edit button is available for the clip tool once the registry change is made:

Here are ESRI's intructions which are currently valid up to 9.3.1:

Curious where the documentation is stored?  Look in the help\gp  folder in your default installation directory, for example on a 64bit machine it would be:
"C:\Program Files (x86)\ArcGIS\Desktop10.0\help\gp\Clip_analysis.xml"

When you deploy your custom tool, you can copy this help file into the correct directory at install time, and your custom tool will have full documentation.

ArcGIS Desktop 10.0 bug!  The tool description is linked to the Catalog Tree.  If you right click a tool in ArcToolbox and select "Item Description...", the window that pops up is still linked to the Catalog Tree, not the tool you selected and right-clicked in ArcToolbox!