Steve Michelotti

A .NET Developer's Toolbox

  Home  |   Contact  |   Syndication    |   Login
  201 Posts | 0 Stories | 1110 Comments | 51 Trackbacks

News

View Steve Michelotti's profile on LinkedIn

profile for Steve Michelotti at Stack Overflow, Q&A for professional and enthusiast programmers




Google My Blog

What I'm Reading:

Shelfari: Book reviews on your book blog

Tag Cloud


Archives

Post Categories

Code

Publications

January 2006 Entries

VS2005 Team System has the capability of seamlessly integrating FxCop inside the IDE. This is also possible with non-Team System versions such as Professional edition by using External Tools - the FxCop documentation for this can be found here: http://www.gotdotnet.com/te... So what happens if you want to have this convenient IDE integration but point your analysis at an *.FxCop project file rather than pointing directly to assemblies? The main thing you have to ......

I recently submitted an article about Nullable Data Readers .NET 2.0 for review which was posted here: http://www.codeproject.com/... As a quick supplemental example for that article, suppose you have a non-nullable type in your business object that you're populating with from a nullable field in the database (this might also happen when populated from an outer join). This is a good opportunity to use the new nullable coalesce operator (aka, conditional assignmenet) in C# 2.0 ......

In my last post, I discussed creating a static class for Parsing nullable types: http://geekswithblogs.net/m... However, 2.0 also introducing a new TryParse() pattern so that developers would not have to rely on catching exceptions when attempting a Parse() method. For example: http://msdn2.microsoft.com/... We can incorporate the TryParse pattern into our NullableParser class as well so that our consuming code to look something like this: ......

Often when working with a textbox or some other control, it is necessary to call the Parse() method to do a conversion for our business object property. For example, consider a web form where you are assigning: person.DateOfBirth = DateTime.Parse(txtDateOfBir... This is all well and good if your field is required and you've already got a UI validation ensuring that the user typed a date into the text box. But what do you do if the field is not required and you'd like to use Nullable for your ......

If you're using Visual Studio 2005 Team System then FxCop is completely integrated and when you exclude messages it automatically applies the new SuppressMessage attributes to the appropriate location in code. But if you're using Visual Studio Professional edition then you have to use the external FxCop 1.35 UI. If this is the case, you can STILL utilize the SuppressMessage attribute but have to do a couple of things first. I had to do a little digging but the steps are pretty simple. It turns out ......