Monday, March 1, 2010

Partial Methods in c# 2008

C# 2008 widens the scope of the partial keyword in that it can now be applied on the methodlevel. In a nutshell, this allows you to prototype a method in one file, yet implement it in another file.
Partial methods can only be defined within a partial class.
• Partial methods must return void.
• Partial methods can be static or instance level.
• Partial methods can have arguments (including parameters modified by this, ref, or params—but not with the out modifier).
• Partial methods are always implicitly private.

No comments:

Post a Comment