**** Merged r40732-r40872 from MCS ****
[mono.git] / mcs / class / corlib / System.Reflection / TypeDelegator.cs
1 // System.Reflection/TypeDelegator.cs
2 //
3 // Paolo Molaro (lupus@ximian.com)
4 //
5 // (C) 2002 Ximian, Inc.
6
7 //
8 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
17 // 
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
20 // 
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 //
29
30 using System;
31 using System.Reflection;
32 using System.Globalization;
33
34 namespace System.Reflection {
35
36         [Serializable]
37         public class TypeDelegator : Type {
38                 protected Type typeImpl;
39         
40                 protected TypeDelegator () {
41                 }
42
43                 public TypeDelegator( Type delegatingType)
44                 {
45                         if (delegatingType == null)
46                                 throw new ArgumentNullException ("delegatingType must be non-null");
47                         typeImpl = delegatingType;
48                 }
49
50                 public override Assembly Assembly {
51                         get { return typeImpl.Assembly; }
52                 }
53
54                 public override string AssemblyQualifiedName {
55                         get { return typeImpl.AssemblyQualifiedName; }
56                 }
57
58                 public override Type BaseType {
59                         get { return typeImpl.BaseType; }
60                 }
61
62                 public override string FullName {
63                         get { return typeImpl.FullName; }
64                 }
65
66                 public override Guid GUID {
67                         get { return typeImpl.GUID; }
68                 }
69
70                 public override Module Module {
71                         get { return typeImpl.Module; }
72                 }
73
74                 public override string Name {
75                         get { return typeImpl.Name; }
76                 }
77
78                 public override string Namespace {
79                         get { return typeImpl.Namespace; }
80                 }
81
82                 public override RuntimeTypeHandle TypeHandle {
83                         get { return typeImpl.TypeHandle; }
84                 }
85
86                 public override Type UnderlyingSystemType {
87                         get { return typeImpl.UnderlyingSystemType; }
88                 }
89
90                 protected override TypeAttributes GetAttributeFlagsImpl ()
91                 {
92                         throw new NotImplementedException ();
93                         //return typeImpl.GetAttributeFlagsImpl ();
94                 }
95                 
96                 protected override ConstructorInfo GetConstructorImpl (
97                         BindingFlags bindingAttr, Binder binder, CallingConventions cc,
98                         Type[] types, ParameterModifier[] modifiers)
99                 {
100                         throw new NotImplementedException ();
101                         //return typeImpl.GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
102                 }
103
104                 public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr)
105                 {
106                         return typeImpl.GetConstructors (bindingAttr);
107                 }
108
109                 public override object[] GetCustomAttributes (bool inherit)
110                 {
111                         return typeImpl.GetCustomAttributes (inherit);
112                 }
113
114                 public override object[] GetCustomAttributes (Type attributeType, bool inherit)
115                 {
116                         return typeImpl.GetCustomAttributes (attributeType, inherit);
117                 }
118
119                 public override Type GetElementType()
120                 {
121                         return typeImpl.GetElementType ();
122                 }
123
124                 public override EventInfo GetEvent( string name, BindingFlags bindingAttr)
125                 {
126                         return typeImpl.GetEvent (name, bindingAttr);
127                 }
128
129                 public override EventInfo[] GetEvents()
130                 {
131                         return GetEvents (BindingFlags.Public);
132                 }
133
134                 public override EventInfo[] GetEvents (BindingFlags bindingAttr)
135                 {
136                         return typeImpl.GetEvents (bindingAttr);
137                 }
138
139                 public override FieldInfo GetField (string name, BindingFlags bindingAttr)
140                 {
141                         return typeImpl.GetField (name, bindingAttr);
142                 }
143
144                 public override FieldInfo[] GetFields( BindingFlags bindingAttr)
145                 {
146                         return typeImpl.GetFields (bindingAttr);
147                 }
148
149                 public override Type GetInterface( string name, bool ignoreCase)
150                 {
151                         return typeImpl.GetInterface (name, ignoreCase);
152                 }
153
154                 public override InterfaceMapping GetInterfaceMap( Type interfaceType)
155                 {
156                         return typeImpl.GetInterfaceMap (interfaceType);
157                 }
158                 
159                 public override Type[] GetInterfaces ()
160                 {
161                         return typeImpl.GetInterfaces ();
162                 }
163
164                 public override MemberInfo[] GetMember( string name, MemberTypes type, BindingFlags bindingAttr)
165                 {
166                         return typeImpl.GetMember (name, type, bindingAttr);
167                 }
168
169                 public override MemberInfo[] GetMembers( BindingFlags bindingAttr)
170                 {
171                         return typeImpl.GetMembers (bindingAttr);
172                 }
173
174                 protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
175                 {
176                         throw new NotImplementedException ();
177                         //return typeImpl.GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
178                 }
179
180                 public override MethodInfo[] GetMethods( BindingFlags bindingAttr)
181                 {
182                         return typeImpl.GetMethods (bindingAttr);
183                 }
184
185                 public override Type GetNestedType( string name, BindingFlags bindingAttr)
186                 {
187                         return typeImpl.GetNestedType (name, bindingAttr);
188                 }
189
190                 public override Type[] GetNestedTypes( BindingFlags bindingAttr)
191                 {
192                         return typeImpl.GetNestedTypes (bindingAttr);
193                 }
194
195                 public override PropertyInfo[] GetProperties( BindingFlags bindingAttr)
196                 {
197                         return typeImpl.GetProperties (bindingAttr);
198                 }
199
200                 protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
201                 {
202                         throw new NotImplementedException ();
203                         //return typeImpl.GetPropertyImpl (name, bindingAttr, bindingAttr, returnType, types, modifiers);
204                 }
205
206                 protected override bool HasElementTypeImpl()
207                 {
208                         throw new NotImplementedException ();
209                         //return typeImpl.HasElementTypeImpl ();
210                 }
211
212                 public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
213                         return typeImpl.InvokeMember (name, invokeAttr, binder, target, args, modifiers, culture, namedParameters);
214                 }
215
216                 protected override bool IsArrayImpl()
217                 {
218                         throw new NotImplementedException ();
219                         //return typeImpl.IsArrayImpl ();
220                 }
221
222                 protected override bool IsByRefImpl()
223                 {
224                         throw new NotImplementedException ();
225                         //return typeImpl.IsByRefImpl ();
226                 }
227
228                 protected override bool IsCOMObjectImpl()
229                 {
230                         throw new NotImplementedException ();
231                         //return typeImpl.IsCOMObjectImpl ();
232                 }
233
234                 public override bool IsDefined( Type attributeType, bool inherit) {
235                         return typeImpl.IsDefined (attributeType, inherit);
236                 }
237
238                 protected override bool IsPointerImpl()
239                 {
240                         throw new NotImplementedException ();
241                         //return typeImpl.IsPointerImpl ();
242                 }
243
244                 protected override bool IsPrimitiveImpl()
245                 {
246                         throw new NotImplementedException ();
247                         //return typeImpl.IsPrimitiveImpl ();
248                 }
249
250                 protected override bool IsValueTypeImpl()
251                 {
252                         throw new NotImplementedException ();
253                         //return typeImpl.IsValueTypeImpl ();
254                 }
255 #if NET_2_0 || BOOTSTRAP_NET_2_0
256                 public override Type[] GetGenericArguments ()
257                 {
258                         throw new NotImplementedException ();
259                 }
260
261                 public override bool HasGenericArguments {
262                         get {
263                                 throw new NotImplementedException ();
264                         }
265                 }
266
267                 public override bool ContainsGenericParameters {
268                         get {
269                                 throw new NotImplementedException ();
270                         }
271                 }
272
273                 public override bool IsGenericParameter {
274                         get {
275                                 throw new NotImplementedException ();
276                         }
277                 }
278
279                 public override int GenericParameterPosition {
280                         get {
281                                 throw new NotImplementedException ();
282                         }
283                 }
284
285                 public override MethodInfo DeclaringMethod {
286                         get {
287                                 throw new NotImplementedException ();
288                         }
289                 }
290 #endif
291
292         }
293 }