Add a more functional (i.e. fewer-stubs) implementation of System.Data.Linq.
[mono.git] / mcs / docs / ecma334 / 17.2.7.1.xml
1 <?xml version="1.0"?>
2 <clause number="17.2.7.1" title="Member Names Reserved for Properties">
3   <paragraph>For a property P (<hyperlink>17.6</hyperlink>) of type T, the following signatures are reserved: <code_example><![CDATA[
4 T get_P();  
5 void set_P(T value);  
6 ]]></code_example></paragraph>
7   <paragraph>Both signatures are reserved, even if the property is read-only or write-only. </paragraph>
8   <paragraph>
9     <example>[Example: In the example <code_example><![CDATA[
10 using System;  
11 class A {  
12    public int P {  
13       get { return 123; }  
14    }  
15 }  
16 class B: A {  
17    new public int get_P() {  
18       return 456;  
19    }  
20    new public void set_P(int value) {  
21    }  
22 }  
23 class Test  
24 {  
25    static void Main() {  
26       B b = new B();  
27       A a = b;  
28       Console.WriteLine(a.P);  
29       Console.WriteLine(b.P);  
30       Console.WriteLine(b.get_P());  
31    }  
32 }  
33 ]]></code_example>a class A defines a read-only property P, thus reserving signatures for get_P and set_P methods. A class B derives from A and hides both of these reserved signatures. The example produces the output: <code_example><![CDATA[
34 123  
35 123  
36 456  
37 ]]></code_example>end example]</example>
38   </paragraph>
39 </clause>