[ACCEPTED]-What does "T @this" mean in a delegate declaration?-generics

Accepted answer
Score: 38

The @this means you can use the keyword this as a 2 variable.

The T is simply the first open generic 1 type of WeakEventHandler<T, E>.

Score: 37

The @ symbol allows you to escape identifiers 12 within your code.

See MSDN -

The rules for 11 identifiers given in this section correspond 10 exactly to those recommended by the Unicode 9 Standard Annex 15, except that underscore 8 is allowed as an initial character (as is 7 traditional in the C programming language), Unicode 6 escape sequences are permitted in identifiers, and 5 the "@" character is allowed as 4 a prefix to enable keywords to be used as 3 identifiers.

http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx

They give this lovely example 2 of escaping:

class @class
{
   public static void @static(bool @bool) {
      if (@bool)
         System.Console.WriteLine("true");
      else
         System.Console.WriteLine("false");
   }   
}

Would like to see that one in 1 a code review!

More Related questions