Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification


24 Attributes
24.3 Attribute instances
24.3.2 Run-time retrieval of an attribute instance
Paragraph 11 Compilation of an attribute yields an attribute class T, an instance constructor C on T, a positional-argument-list P, and a named-argument-list N. 2 Given this information, an attribute instance can be retrieved at run-time using the following steps: - 3 Follow the run-time processing steps for executing an object-creation-expression of the form new T(P), using the instance constructor C as determined at compile-time. 4 These steps either result in an exception, or produce an instance of T. 5 Call this instance O.
- 6 For each named-argument Arg in N, in order:
- 7 Let Name be the identifier of the named-argument Arg. 8 If Name does not identify a non-static public read-write field or property on O, then an exception is thrown.
- 9 Let Value be the result of evaluating the attribute-argument-expression of Arg.
- 10 If Name identifies a field on O, then set this field to the value Value.
- 11 Otherwise, Name identifies a property on O. 12 Set this property to the value Value.
- 13 The result is O, an instance of the attribute class T that has been initialized with the positional-argument-list P and the named-argument-list N.
|
Jagger Software Ltd |
Company # 4070126 |
VAT # 762 5213 42 |

