2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / tests / xml-022.cs
1 // Compiler options: -doc:xml-022.xml
2 //
3 // Combined tests (for detecting incorrect markup targeting).
4 //
5 using System;
6
7 /// <summary>
8 /// xml comment is not allowed here.
9 /// </summary>
10 namespace Testing
11 {
12         /// <summary>
13         /// </incorrect>
14         public class Test2
15         {
16                 /**
17                         another documentation style (Java-mimic)
18                 */
19                 public static void Foo ()
20                 {
21                         /// here is an extraneous comment
22                 }
23
24                 public static void Main ()
25                 {
26                 }
27         }
28
29         /// testing indentation <summary> test test ;-)
30         /// comment for struct
31         /// </summary>
32         public struct StructTest
33         {
34         }
35
36         /// <summary>
37         /// comment for interface
38         /// </summary>
39         public interface InterfaceTest
40         {
41         }
42
43         /// <summary>
44         /// comment for enum type
45         /// </summary>
46         public enum EnumTest
47         {
48                 /// <summary>
49                 /// comment for enum field
50                 /// </summary>
51                 Foo,
52                 Bar,
53         }
54
55         /// <summary>
56         /// comment for dummy type
57         /// </summary>
58         public class Dummy {}
59
60         /// <summary>
61         /// comment for delegate type
62         /// </summary>
63         public delegate void MyDelegate (object o, EventArgs e);
64
65         /// <summary>
66         /// description for class Test
67         /// </summary>
68         public class Test
69         {
70                 /// comment for const declaration
71                 const string Constant = "CONSTANT STRING";
72
73                 /// comment for public field
74                 public string BadPublicField;
75
76                 /// comment for private field
77                 private string PrivateField;
78
79                 /// comment for public property
80                 public string PublicProperty {
81                         /// comment for private property getter
82                         get { return null; }
83                 }
84
85                 /// comment for private property
86                 private string PrivateProperty {
87                         get { return null; }
88                         /// comment for private property setter
89                         set { }
90                 }
91
92                 int x;
93
94                 /// public event EventHandler MyEvent ;-)
95                 public event EventHandler MyEvent;
96
97                 int y;
98
99                 /// here is a documentation!!!
100                 public static void Foo ()
101                 {
102                 }
103
104                 /// here is a documentation with parameters
105                 public static void Foo (long l, Test t, System.Collections.ArrayList al)
106                 {
107                 }
108
109                 /// comment for indexer
110                 public string this [int i] {
111                         get { return null; }
112                 }
113
114                 /// comment for indexer wit multiple parameters
115                 public string this [int i, Test t] {
116                         get { return null; }
117                 }
118
119                 /// <summary>
120                 /// comment for unary operator
121                 /// </summary>
122                 public static bool operator ! (Test t)
123                 {
124                         return false;
125                 }
126
127                 /// <summary>
128                 /// comment for binary operator
129                 /// </summary>
130                 public static int operator + (Test t, int b)
131                 {
132                         return b;
133                 }
134
135                 /// comment for destructor
136                 ~Test ()
137                 {
138                 }
139
140                 /// comment for .ctor()
141                 public Test ()
142                 {
143                 }
144
145                 /// comment for .ctor(string arg, string [] args)
146                 public Test (string arg, string [] args)
147                 {
148                 }
149
150                 /// comment for internal class
151                 public class InternalClass
152                 {
153                 }
154
155                 /// comment for internal struct
156                 public struct InternalStruct
157                 {
158                 }
159         }
160 }
161