Category Archives: C#

Use BitmapScalingMode to ensure your rendering of Image is perfect

By | July 20, 2011

If you have worked with WPF 3.5 before, you know that declaring a normal image in your code will render your image quite fine. But If you do the same thing in .NET 4.0 or even you convert your existing application from previous version to .NET 4.0, all the images that were rendering quite Ok in your previous… Read More »

Get time of Code Execution Using StopWatch

By | July 5, 2011

During Development of the application/product or after deployment of the application/product there might be a situation where you want to find out the the how much time is taken by you code to execute ? Is it too much slow ? Answer to this problem is make use of StopWatch class of System.Diagnostics namespace which is usefull to… Read More »

Lazy Initializer to defer expensive Object creation in .NET 4.0

By | June 30, 2011

.NET 4.0 comes with lots of new features. Some relates to Technology while other relates to language enhancements. The huge class library that is there with .NET framework is also enriched with new classes. In .NET 4.0 there is a new set of classes which introduces a new concept called Lazy initializes. In this article I am going… Read More »

Working with Co-Variance and Contra-Variance in .NET 4.0

By | June 29, 2011

If you literally think of variance, you would say variance is a concept in which if one data varies at a certain time, the other one will vary automatically. And rightly so. In case of .NET, variance comes just in such way. Lets talk about why we need variance or Co-variance in .NET.