3

I'm translating some example code line by line from C# to VB.NET.

The lines which confuse me looks like this:

[Kernel(CustomFallbackMethod = "AddCpu")] 

I see in the code that these lines appear just before the method declaration:

private static void

What kind of line appears before a method declaration? Or is it a continuation of the last? I hope this is obvious to a native C Sharper.

tomfanning
  • 9,552
  • 4
  • 50
  • 78

1 Answers1

4

It's an Attribute. It's a way to mark up code that can be used at runtime or compile time.

I would google VB.NET and Attributes. You can read some passages here on O'Reilly

Your example would be converted to:

       <Kernel(CustomFallbackMethod:="AddCpu")>

Be sure to use _ if you decide to put it on the line before your method.

Community
  • 1
  • 1
Andrew T Finnell
  • 13,417
  • 3
  • 33
  • 49