Category: CSharp
-
Extension Method
Extension method is a feature in c# 3.0, which allows developer to add functionality in existing class without modifying the existing class or recompiling the existing class or extending the existing class. It is a new feature of c#3.0 Extension method enables to add new methods to existing type. It does not need creation of…
-
Working with Dynamic Object in c# 4.0 Part #1
Objective This article will give a basic introduction of Dynamic Object in c# 4.0 DynamicObject class This provides a base class for specifying dynamic behavior at run time. This class must be inherited to use. This class cannot be instantiated. This class is inside namespace System.Dynamic This class implements IDynamicMetaObjectProvider This class enables to define…
-
Dynamic type with Reflection in debug mode
Objective This article will give simple debug mode explanation on how Reflection and Dynamic type works. Note: Read my previous article on dynamic type here Dynamic Type Let us create a very simple class called Student. public class Student{ public void Print(string Name) { Console.WriteLine(“Student Name is “ + Name); }} Now say, you don’t…
-
Lambda Expression
This article will explain about Lambda expression and its usage. This article will also give differences between Lambda expression and Anonymous method. This article will talk about type inference in Lambda expression. This will also talk about delegate type conversion of lambda expression. We will start with a code. This is a very simple code…
-
Accessing Microsoft Office InterOP Objects using C# 4.0
Objective This article will show, how Microsoft office InterOp objects can be access and use in C#. I will be using dynamic type feature of c# 4.0 To create and open an Excel Application in VS2010 To display list in Active Excel Application. To Create and open a word document in VS2010. To create an…
-
Optional Argument in C# 4.0
Objective This article will give a very basic introduction of Optional Argument in C#4.0. This article will explain how Operation overloading and Optional Argument is different with samples. This article will give different syntax with Named parameter to work with Optional arguments. Optional Argument Five facts about Optional Parameter Each Optional Parameter has a default…
-
Named Argument in c# 4.0
Objective In this article I will talk about a very new and highly useful feature of c# 4.0. I will give introduction of Named Argument. I will give one sample on possible usage of Named Argument. Five facts about Named argument There is no need to remember order of the parameter in parameter list. The…
-
Dynamic type in c# 4.0
Objective This article will introduce dynamic type. This article will be giving samples on different usage of dynamic type in programming. Prerequisite: Visual Studio 2010 C# 4.0 is all about Dynamic Programming and type. 10 facts about Dynamic type C# 4.0 allows a new static type called “dynamic”. Any operation on the object of type…