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>
5 <example>[Example: The example <code_example><![CDATA[
7 [AttributeUsage(AttributeTargets.Class)]
8 public class HelpAttribute: Attribute
10 public HelpAttribute(string url) { // url is a positional parameter
13 public string Topic { // Topic is a named parameter
17 public string Url { get {...} }
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>
22 <example>This attribute class might be used as follows: <code_example><![CDATA[
23 [Help("http://www.mycompany.com/.../Class1.htm")]
26 [Help("http://www.mycompany.com/.../Misc.htm", Topic ="Class2")]
29 ]]></code_example>end example]</example>