disable broken tests on net_4_0
[mcs.git] / docs / ecma334 / 24.1.2.xml
blob9ea8c391e4ee7e3491a633e27e9206ff6b458c45
1 <?xml version="1.0"?>
2 <clause number="24.1.2" title="Positional and named parameters">
3   <paragraph>Attribute classes can have positional parameters and named parameters. Each public instance constructor for an attribute class defines a valid sequence of positional parameters for that attribute class. Each  non-static public read-write field and property for an attribute class defines a named parameter for the attribute class. </paragraph>
4   <paragraph>
5     <example>[Example: The example <code_example><![CDATA[
6 using System;  
7 [AttributeUsage(AttributeTargets.Class)]  
8 public class HelpAttribute: Attribute  
9 {  
10    public HelpAttribute(string url) {  // url is a positional parameter  
11       ...  
12    }  
13    public string Topic {  // Topic is a named parameter  
14       get {...}  
15       set {...}  
16    }  
17    public string Url { get {...} }  
18 }  
19 ]]></code_example>defines an attribute class named HelpAttribute that has one positional parameter (string url) and one named parameter (string Topic). Although it is non-static and public, the property Url does not define a named parameter, since it is not read-write. </example>
20   </paragraph>
21   <paragraph>
22     <example>This attribute class might be used as follows: <code_example><![CDATA[
23 [Help("http://www.mycompany.com/.../Class1.htm")]  
24 class Class1 {  
25 }  
26 [Help("http://www.mycompany.com/.../Misc.htm", Topic ="Class2")]  
27 class Class2 {  
28 }  
29 ]]></code_example>end example]</example>
30   </paragraph>
31 </clause>