Monday, June 14, 2010

Extension Method

public static {Method Return type} {Method Name}(this {The Class to Extend} {Parameter Name})

public static int IsOdd(this int value)
{
return value%2 != 0
}

Extension method must in static class.
must declared as public and static.

delegate

{Modifier} delegate {Method Return type} {Delegate Name}({Parameter type} {Parameter Name})

public delegate int MyIntDelegate(int number);