Using Delegates and Events

Delegates are object-oriented function pointers that safely encapsulate a method. A delegate must be of type delegate, define a return type and optionally a parameter list, like this:

public delegate void ImDelegate(int x, int y);

This delegate then can point to any methods which returns void and takes two integer values as parameters. To try our new delegate add the following code:

public static void Add(int x, int x)
{
  Console.WriteLine(x+y);
}
ImDelegate handler = Add;
Handler(12, 23);

Continue reading “Using Delegates and Events”

Getting Certified – .NET 70-536

OK, I’ve rested enough after taking my last exam, it’s time to continue learning. My evil plan is to earn the MCPD in Enterprise Application Development, and this means taking a bunch of exams.

The one I’d like to take the least is the 70-536, the Microsoft .NET Framework-Application Development Foundation exam, but this is a prerequisite for all MCTS exams, so I think I might as well take it first. So from tomorrow, you can follow my posts about each topic (there are 37, so I plan to publish 37 posts). I’ll take the exam in about one month (remember, Second Shot is out there only until June 31th).

I think it will be a little bit tougher for me than the ASP.NET exam, because as a web developer, I’m focusing on the ASP.NET technology in my everyday work, but I like challenges.

So the plan is to use the Training Kit for this exam (I read it one time, but I think it won’t be sufficient for the actual exam. The Apress book I plan to re-read is the Pro C# and the .NET 3.5 Platform, by Andrew Troelsen, and of course, MSDN. For this, Niall Merrigan’s collection of MSDN links will be a great resource (as was his ASP.NET MSDN article collection). These three resources will be enough, I think. And of course, MeasureUp.

Anyway, check back tomorrow for an exam plan and the first post, which will be about the .NET system types.