Browse by Tags

All Tags » .NET Development (RSS)

Working with Resharper's External Annotation XML Files

Resharper 4.0 has external annotation XML files that you can create to give Resharper more information about your code. For example, you can tell Resharper that a particular method does not accept a null argument. For example, the following method does...

Drag-copying in Visual Studio Solution Explorer.

NOTE: I've tried this in Visual Studio 2008 (VS2k8), I'm assuming the same thing happens in Visual Studio 2005 (VS2k5). In the process of refactoring, it's *very* common for me to rename a type. This is most easily done by renaming the file...

Nested Types

Recently Michael Features blogged about nested types . The title was almost "nested types considered harmful". I don't agree. I don't agree that they're any more harmful than any other C# construct (except goto...). Nested types...

Sandcastle Source Code Published

The source for the Sandcastle project has been published . This is great news. For more information, see http://www.codeplex.com/Sandcastle/SourceControl/ListDownloadableCommits.aspx .

Comparing CodeRush Refactor! Pro and Resharper 4, part 1 or N -- first glance.

Metadata view of code in referenced assemblies This is a big one for me. For whatever reason, Refactor 4 (and prior) completely disables this and sends you to the Object Browser instead. You get metadata view with CodeRush Refactor! Pro. Keyboard layout...

Entity Framework Petition of Vote of Non Confidence

I had intended to be happy simply being a signatory of ADO .NET Entity Framework Vote of No Confidence. But, there's people suggesting signatories of this petition are wackos or on the fringe. Do yourself a favour and read the petition . Read what...

Spaces or Tabs?

In this day and age it seems silly to get into a discussion about whether your companies coding guidelines should have a section mandating either spaces or tabs for indents. Tabs are clearly more flexible, but I really don't think it matters at all;...

DevTeach Toronto 2008

Well, DevTeach Toronto 2008 is just wrapping up. It was a fantastic conference, many world-class developers, world-class presenters, and world-class topic. Congrats to all. It was well organized that the tracks that I took part in were well designed....

en POCO

First of all, let me describe what a POCO is. "POCO" is a Plain-Old-CLR-Object. This means that it does nothing more than be that encapsulated type implemented by that class. It has SRP and has no other responsibility than that responsibility...
Posted by PeterRitchie | with no comments
Filed under:

Overcoming problems with MethodInfo.Invoke of methods with by-reference value type arguments

I ran into an interesting problem on the Forums recently. Basically, when you use MethodInfo.Invoke to invoke a method with by-reference value type arguments you can't have the invoked method update a variable/argument. The problem is, when you invoke...

Licences for Microsoft products

Occasionally I get development questions that are governed by one or more product licenses (End-User License Agreement, "EULA"). One question that I see is "I've used Reflector to decompile the .NET Framework and want to use that C#...
Posted by PeterRitchie | 7 comment(s)
Filed under: ,

Upcoming C# 3 Guidance From Microsoft

Mircea Trofin has some design guidelines with regard to some C# 3 language additions (that I assume will make it into a revised Framework Design Guidelines of some sort). They more less agree with the guidelines I published in Code Magazine a while ago...

Single-Entry, Single-Exit, Should It Still Be Applicable In Object-oriented Languages?

Before the modern high-level languages Edsger Dijkstra came up with "Structured Programming". This programming methodology relied on the programmer to form and enforce most of the structure of the program--manually keeping sub-structures and...

No "Add Method Stub" When Passing or Assigning Delegates

I finally noticed the other day the "Add method stub" SmartTag wasn't appearing for a new method name I type in. I decided I'd have a closer look... When you're practicing Test-Driven Development (TDD) you want to write a test for...

CoDe Magazine Article.

The January/February edition of Code Magazine includes my article " C# 3.0 Syntax Additions-Design Guidelines ".

"Object is currently in use elsewhere" error.

I was debugging what I thought was a strange exception the other day. The exception was an InvalidOperationException and the message was "Object is currently in use elsewhere". Unless you're familiar with this exception, it really doesn't...

Formatting/parsing for a specific culture redux

In recent blog post I detailed how creating a culture via the CultureInfo constructor could actually create a user-overridden culture--which could be completely different than the culture that you've requested by name. Fortunately there's a way...

Visual C# Developer Center Article

My latest Visual C# Developer Center Article Inferred Typing with Factory Methods as Extension Methods is now online.
Posted by PeterRitchie | with no comments

Formatting/parsing for a specific culture

Sometimes you may want to use a specific format for formatting and parsing of textual data. The easiest way to do this is to select a specific culture and use that with formatting and parsing methods. Unfortunately, the CultureInfo constructor that just...

Bridges and Factories

In my previous post , I talked about Dependency Injection (DI). One implementation of DI is using interface-oriented design to abstract a class from an injected dependency via an interface. This is one possible implementation of the Bridge pattern. Depending...
More Posts Next page »