Recent Posts
Calendar
November 2013
S M T W T F S
« Oct    
 12
3456789
10111213141516
17181920212223
24252627282930

Posts Tagged ‘function’

Self Executing Anonymous Function

arct-059Not because it is all that new, but because it took me a while to find it, here’s how to create a self executing anonymous function using CSharp, just like you can do in JavaScript.

((Func<int>)(delegate()
{
   return 0;
}))();


Func<int> says the the delegate will return an integer.  If you need to pass a parameter you can use the alternate form of Func<parameterType,returnType>

delegate() {return 0;} is just basic delegate syntax that I’ve discussed in the past.

Read the rest of this entry »

Easily Find Classes, Methods, and Variables

I02B0065 There is a bit of a “trick” that I use routinely in Visual Studio to help me find the definition of Classes, Methods, and Variables in my solution regardless.

This “trick” works in both CSharp and in VB.NET and, if you don’t know it already, will save you a ton of time.

Read the rest of this entry »