Browse by Tags

All Tags » C# (RSS)

You learn something new every day

I’ve been writing C# code since one of the early betas back in 2001, yet I’ve never run across the following: error CS1638: 'ToString_WithCache__ShouldReturnICompositionElementDisplayName' is a reserved identifier and cannot be used when ISO language...
Posted by David Kean | with no comments
Filed under:

Documenting ‘undocumented’ features

MMayerl asks over on the MSDN wiki , why we don’t document the undocumented C# keywords __makeref , __reftype , __ refvalue and __arglist ? Because that defeats of the purpose of them being undocumented. They are undocumented for a reason; so that...
Posted by David Kean | 2 comment(s)
Filed under: ,

Return an empty IEnumerable<T> from a yield iterator

This question came up the other day: How do I return an empty IEnumerable<T> from a method using the C# yield keyword? There are actually two ways of doing this. Both, admittedly, are not the most intuitive things in C#: yield break Do not return...
Posted by David Kean | 4 comment(s)
Filed under: