-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExampleClass.cs
191 lines (148 loc) · 4.18 KB
/
ExampleClass.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
using System;
using System.Collections;
using System.Threading;
namespace csharp_layout
{
public abstract class ExampleClass : IEquatable<ExampleClass>, ICloneable, ICollection, ExampleClass.ITestInternal
{
private string Foo()
{
return null;
}
public int Bar()
{
return 0;
}
public int _x1;
private int _a2;
protected internal readonly int _m3 = 5;
private int _count;
private bool _isSynchronized;
private object _syncRoot;
int ICollection.Count => _count;
public bool IsSynchronized => _isSynchronized;
private ExampleClass(int x)
{
}
public int Mm102 { get; }
public int Aa103 { get; }
public ExampleClass()
{
}
internal interface ITestInternal
{
string Test1();
string Test2();
int Test3();
}
internal static int _x4;
public const int Q5 = 1;
private const int B6 = 2;
public ExampleClass(string x)
{
}
protected int Dd104 { get; set; }
static ExampleClass()
{
// Static constructors are always private, so will never appear in API documentation
}
internal protected struct InnerStruct
{
public string FieldValue;
}
public event EventHandler<string> YyEvent;
public event EventHandler<string> RrEvent {
add { }
remove { }
}
public delegate string UuuDelegate(int a, int b);
private struct AnotherStruct
{
public int Aaa001;
}
public class JjjInner
{
public string Pppp { get; set; }
}
internal event EventHandler<int> TtEvent;
protected abstract void Internal();
protected ExampleClass(bool x)
{
const string Note1 = "Public, or even protected, inner classes are rare";
}
public string this[int i]
{
get { return null; }
set { }
}
internal string Secret
{
get { return null; }
}
internal delegate void AnotherDelegate();
public bool Equals(ExampleClass other)
{
throw new NotImplementedException();
}
private class Wwww
{
public int Hhh { get; set; }
public int Fff { get; set; }
}
void ICollection.CopyTo(Array array, int index)
{
throw new NotImplementedException();
}
private enum Blah
{
Unknown = 0,
ThisIsRatherRare = 1,
ToHaveInternalDefinitions = 2,
ButDoesSometimesHappen =3
}
~ExampleClass()
{
// Destructors (finalizers) are always private, so will never appear in API documentation
throw new NotImplementedException();
}
public enum PubEnum
{
InnerEnum,
InnerEnum2
}
private object this[string key]
{
get { return ""; }
}
public static string operator +(ExampleClass a, ExampleClass b)
{
return "Operators must be public and static";
}
protected static int Eeee(int x)
{
return 1;
}
public object Clone()
{
return "Interface implementations must be either public";
}
IEnumerator IEnumerable.GetEnumerator()
{
return "Or must be explicitly implemented".GetEnumerator();
}
public virtual string Test2()
{
return "Even internal interfaces must be public (or explicit)";
}
object ICollection.SyncRoot => _syncRoot;
string ITestInternal.Test1()
{
return null;
}
public interface AnotherInterface
{
void MyMethod7();
}
public abstract int Test3();
}
}