开发者

Unable to identify some C# syntax for translation to VB.NET

开发者 https://www.devze.com 2023-03-10 07:18 出处:网络
I\'m translating some example code line by line from C# to VB.NET. 开发者_如何学JAVAThe lines which confuse me looks like this:

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

开发者_如何学JAVAThe 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消