MickeyP (20) [Avatar] Offline
#1
At the bottom of p262, you've talked about creating an extension method with same signature as an existing static method of the extended type. e.g extension method for IsNullOrEmpty on the string extended type.

Tried it, and it works fine, but worth knowing that VS Intellisence gets slightly thrown when displaying the available methods dropdown listbox and it displays the existing static method (old signature and icon) instead of the newly created extension method. So unless you created the extension method yourself, it could cause confusion as you may (incorrectly) think its an instance method, and also the old signature doesn't make sence either when applied to a variable of the type.

Guess this is a VS foible that someone should tell them about.
jon.skeet (451) [Avatar] Offline
#2
Re: 10.2.4 p 262 intellisence can get itself tied in knots
Interesting. Will try it for myself and capture a screenshot, then create an issue on connect.microsoft.com as well as writing a note about it.
mgravell (64) [Avatar] Offline
#3
Re: 10.2.4 p 262 intellisence can get itself tied in knots
I can reproduce; let me know if you want a screen.
jon.skeet (451) [Avatar] Offline
#4
Re: 10.2.4 p 262 intellisence can get itself tied in knots
Added a new note here: http://csharpindepth.com/ViewNote.aspx?NoteID=148

(Thanks for the screenshot Marc, but I thought in the end it would be worth creating one which used the specific example already in the book.)