Category Archives: C#

Working with Zip Files in .NET

By | October 19, 2013

Zipping and Unzipping in a Client Application or a Website is very common requirement. Until the latest .NET version, there is no API that fully supports these things. We would have relied on J# specific JAVA APIs or there are superior 3rd party APIs available which could have done the trick. .NET 4.5 gives an edge on handling… Read More »

Setting Default Global Timeout for Regular expressions

By | October 18, 2013

In my previous post, I mentioned about the capability of specifying a Timeout while executing a Regular expression. Sometimes, when your application is totally developed, and it would be a heck to change every single code which uses regular expression to specify a timeout. Sometimes the Regular expression is parsed inside an external assembly. In such cases, you… Read More »

How to implement Event Accessors and Single Handler Events

By | October 9, 2013

Event accessor is not new concept. It has been part of C# language from its inception. If you have ever built a class which has an Event with it, you might have already used it. The .NET automatically adds one Event Accessor inside the event when you define one without it. Unlike VB.NET, the event accessor does not… Read More »

A better switch with Lambdas in .NET, Part 4 (Working with Types)

By | September 24, 2013

When dealing with the new Switch case constructs, I always wanted to add more to it. After adding things to it like, replacing the previous switch /case with lambdas, then adding a StringComparer and then adding IComparer, I thought let us add something really useful to it. The switch with Types is always one might have wanted with… Read More »

How to add Caller Info Attributes to an Environments that doesn’t support it

By | September 20, 2013

If you are building a class library with Retargetable turned on, you might end up your assemblies to be used by some environment that does not support some of the functionality that is well required by the assembly. Let us consider the case with Caller Info Attributes. Caller Info attributes are a good way of determining the name… Read More »