In the last post related to Roslyn we developed a very basic syntax walker. In this post we will see how we can use the same for code analysis and checking. As a good practice we generally try to avoid having instance members in a singleton class. This is true if you are making your [...]
Posts Tagged ‘C#’
Roslyn CTP–Syntax Tree–Part II–Singleton Checker
Posted: November 20, 2011 in .NET, C#Tags: C#, Roslyn CTP
Roslyn CTP–A Walk Through The Syntax Tree–Part I
Posted: November 20, 2011 in .NET, C#Tags: C#, Roslyn, Syntax API
The Roslyn project aims to expose the functionalities of C#/VB complier as API/Services. The Roslyn CTP was released this October.One of the important components of Roslyn is the Compiler API. This exposes an object model which provides access to information generated at the different stages of compilation.The first phase of any compilation process involves parsing [...]
C# Extension methods were introduced in C# 3.0. They provide a mechanism to extend(not the inheritance way) the functionality of an existing class by attaching methods to it.An extension method needs to be developed in a static class as a static method as shown below: We can invoke it as In this post we will [...]
Sorting Collections in C#
Posted: May 7, 2011 in .NET, C#Tags: C#, Comparison, IComparer, IComprable, Sort
In this post we will discuss about different techniques of sorting collections of objects in C# using the functions provided by the base class libraries.This is something very common and there different types of provisions in .NET BCL to achieve the same.We will try to discuss the advantages and limitations of each of these approaches. [...]
Type Casting in CLR – Introduction(C#)
Posted: October 24, 2010 in .NET, C#Tags: .NET CLR, C#, Type Conversion
In this post and couple of posts to follow, we will discuss about the different type casting mechanisms supported by CLR and the three primary CLR supported languages C#,VB.NET and C++/CLI.To start with, lets take a look into the two possible kinds of conversion scenarios, that generally we come across.
In my last post I had discussed about delegates in C# but intentionally skipped the covariance and contravariance with respect to delegates.I would like to discuss the concepts of covariance and contravariance in general first and then correlate the same in context of C# delegates.The concept of covariance and contravariance I found a bit confusing [...]

