C# appel de la méthode de l'interface au sein de la classe

interface ILol
{
   void LOL();
}

class Rofl : ILol
{
   void ILol.LOL()
   {
      GlobalLOLHandler.RaiseROFLCOPTER(this);
   }
   public Rofl()
   {
      //Is there shorter way of writing this or i is there "other" problem with implementation??
      (this as ILol).LOL();
   }
}
Essayez d'éviter d'appeler le "virtuel" de fonctions à partir d'un constructeur! Vous pouvez retrouvez l'appel d'une application qui accède à un pas entièrement à l'objet construit.

OriginalL'auteur 0xDEAD BEEF | 2010-05-10