Add a more functional (i.e. fewer-stubs) implementation of System.Data.Linq.
[mono.git] / mcs / docs / ecma334 / 24.3.2.xml
1 <?xml version="1.0"?>
2 <clause number="24.3.2" title="Run-time retrieval of an attribute instance">
3   <paragraph>Compilation of an attribute yields an attribute class T, an instance constructor C on T, a  <non_terminal where="24.2">positional-argument-list</non_terminal> P, and a <non_terminal where="24.2">named-argument-list</non_terminal> N. Given this information, an attribute instance can be retrieved at run-time using the following steps: <list><list_item> Follow the run-time processing steps for executing an <non_terminal where="14.5.10.1">object-creation-expression</non_terminal> of the form new T(P), using the instance constructor C as determined at compile-time. These steps either result in an exception, or produce an instance of T. Call this instance O. </list_item><list_item> For each <non_terminal where="24.2">named-argument</non_terminal> Arg in N, in order: </list_item><list><list_item> Let Name be the identifier of the <non_terminal where="24.2">named-argument</non_terminal> Arg. If Name does not identify a non-static public read-write field or property on O, then an exception is thrown. </list_item><list_item> Let Value be the result of evaluating the <non_terminal where="24.2">attribute-argument-expression</non_terminal> of Arg. </list_item><list_item> If Name identifies a field on O, then set this field to the value Value. </list_item><list_item> Otherwise, Name identifies a property on O. Set this property to the value Value. </list_item><list_item> The result is O, an instance of the attribute class T that has been initialized with the  <non_terminal where="24.2">positional-argument-list</non_terminal> P and the <non_terminal where="24.2">named-argument-list</non_terminal> N. </list_item></list></list></paragraph>
4 </clause>