Tag Archives: C# 4.0

LINQ beyond Queries – by Scott Allen

Today I share with you a very interesting Channel 9 session presented by Scott Allen during Microsoft DevDays 2010 in The Hague in The Netherlands. The C# language and the .NET platform introduced many new features to support language integrated query.  In this session, we’ll look at using these LINQ related features to build rich, […]

Localization / Globlization on the fly

Have you ever wondered about creating and editing .resx resources files at runtime ? Let’s say you build an application supporting globalization/localization and the values of some of your items is not known upfront. In this case, we’ll assume that you allow the end-user to create his own resources entries that will be used at […]

Generate a random string

If you’ve ever wanted to generate some random strings, here is a piece of code that can be helpful at times. Note that you can supply any other content for the array to choose the new string’s characters from.   private string GenerateRandomString(int length)         {             Char[] allowedChars = GetPrintableCharacters();             char[] chars = […]

C# 4.0 Option argument corner cases…By Eric Lippert

For all of your working with C# 4.0, you’ve surely been using optional arguments in order to define specific constants that can be used when calling a method if certain arguments are omitted. Interestingly enough, this functionality does not come ‘for free’ and Eric Lippert, a developer in the C# compiler team has written four […]