using System;
class Bar: Attribute
{
  static Bar()
  {
    Foo.WriteNumberOfCustomAttributes();
  }
  public Bar()
  {
    Console.Write("Bar ");
  }
}
[Bar]
class Foo
{
  public static void WriteNumberOfCustomAttributes()
  {
    Console.Write(typeof(Foo).GetCustomAttributes(false).Length + " ");
  }
  static void Main()
  {
    WriteNumberOfCustomAttributes();
    Console.Read();
  }
}
Cosa viene visualizzato a console?
- A. 1 
- B. 1 1 
- C. 1 Bar 1 
- D. 1 Bar 1 Bar 
- E. Bar 1 Bar 1
E perché?