Monday, May 23, 2016

partial (Method)

A partial method has its signature defined in one part of a partial type, and its implementation defined in another part of the type. Partial methods enable class designers to provide method hooks, similar to event handlers, that developers may decide to implement or not. If the developer does not supply an implementation, the compiler removes the signature at compile time. The following conditions apply to partial methods:

  • Signatures in both parts of the partial type must match.

  • The method must return void.

  • No access modifiers are allowed. Partial methods are implicitly private.

namespace PM  {      partial class A      {          partial void OnSomethingHappened(string s);      }        // This part can be in a separate file.       partial class A      {          // Comment out this method and the program           // will still compile.           partial void OnSomethingHappened(String s)          {              Console.WriteLine("Something happened: {0}", s);          }      }  }

1 comment:

  1. A Vegas experience takes you on a transformative journey - Dr
    The Wynn buffet, which opened 서귀포 출장샵 in 나주 출장마사지 2005, is 광주 출장마사지 a great place for those looking to dip in the The buffet 강릉 출장안마 at 군산 출장마사지 Wynn Las Vegas opened its doors in April 2005, and since it's

    ReplyDelete

Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code