This might be a stupid question, or oversight on my part, but.. If you type 'method' inside an attribute definition, as below:
[method: ]
public class MyClass
Visual Studio highlights the keyword. It doesn't seem to highlight it outside of an attribute as far as I can tell, and hitting F1 in VS boots you to a 404.
I've never seen this actually used, and I can't find any information on it.
Anyone know what it does?
A method is a code block that contains a series of statements. A program causes the statements to be executed by calling the method and specifying any required method arguments.
The C standard library provides numerous built-in functions that your program can call. For example, strcat() to concatenate two strings, memcpy() to copy one memory location to another location, and many more functions. A function can also be referred as a method or a sub-routine or a procedure, etc.
Keywords are words that have special meaning to the C compiler. In translation phases 7 and 8, an identifier can't have the same spelling and case as a C keyword. For more information, see translation phases in the Preprocessor Reference. For more information on identifiers, see Identifiers.
See Disambiguating Attribute Targets (C# Programming Guide).
Basically, it's to disambiguate between attribute applied to a method and attribute applied to the return value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With