Adjust sleeping values
[mono.git] / mcs / class / corlib / System.Reflection / TypeDelegator.cs
old mode 100755 (executable)
new mode 100644 (file)
index a87d26d..32c143b
@@ -4,12 +4,37 @@
 //
 // (C) 2002 Ximian, Inc.
 
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
 using System;
 using System.Reflection;
 using System.Globalization;
+using System.Runtime.InteropServices;
 
 namespace System.Reflection {
 
+       [ComVisible (true)]
        [Serializable]
        public class TypeDelegator : Type {
                protected Type typeImpl;
@@ -66,18 +91,17 @@ namespace System.Reflection {
 
                protected override TypeAttributes GetAttributeFlagsImpl ()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.GetAttributeFlagsImpl ();
+                       return typeImpl.Attributes;
                }
                
                protected override ConstructorInfo GetConstructorImpl (
-                       BindingFlags bindingAttr, Binder binder, CallingConventions cc,
+                       BindingFlags bindingAttr, Binder binder, CallingConventions callConvention,
                        Type[] types, ParameterModifier[] modifiers)
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.GetConstructorImpl (bindingAttr, binder, callConvention, types, modifiers);
+                       return typeImpl.GetConstructor (bindingAttr, binder, callConvention, types, modifiers);
                }
 
+               [ComVisible (true)]
                public override ConstructorInfo[] GetConstructors( BindingFlags bindingAttr)
                {
                        return typeImpl.GetConstructors (bindingAttr);
@@ -128,6 +152,7 @@ namespace System.Reflection {
                        return typeImpl.GetInterface (name, ignoreCase);
                }
 
+               [ComVisible (true)]
                public override InterfaceMapping GetInterfaceMap( Type interfaceType)
                {
                        return typeImpl.GetInterfaceMap (interfaceType);
@@ -150,8 +175,8 @@ namespace System.Reflection {
 
                protected override MethodInfo GetMethodImpl( string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.GetMethodImpl (name, bindingAttr, binder, callConvention, types, modifiers);
+                       // Can't call GetMethod since it makes restrictive argument checks
+                       return typeImpl.GetMethodImplInternal (name, bindingAttr, binder, callConvention, types, modifiers);
                }
 
                public override MethodInfo[] GetMethods( BindingFlags bindingAttr)
@@ -176,14 +201,13 @@ namespace System.Reflection {
 
                protected override PropertyInfo GetPropertyImpl( string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.GetPropertyImpl (name, bindingAttr, bindingAttr, returnType, types, modifiers);
+                       // Can't call GetProperty since it makes restrictive argument checks
+                       return typeImpl.GetPropertyImplInternal (name, bindingAttr, binder, returnType, types, modifiers);
                }
 
                protected override bool HasElementTypeImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.HasElementTypeImpl ();
+                       return typeImpl.HasElementType;
                }
 
                public override object InvokeMember( string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) {
@@ -192,20 +216,17 @@ namespace System.Reflection {
 
                protected override bool IsArrayImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.IsArrayImpl ();
+                       return typeImpl.IsArray;
                }
 
                protected override bool IsByRefImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.IsByRefImpl ();
+                       return typeImpl.IsByRef;
                }
 
                protected override bool IsCOMObjectImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.IsCOMObjectImpl ();
+                       return typeImpl.IsCOMObject;
                }
 
                public override bool IsDefined( Type attributeType, bool inherit) {
@@ -214,57 +235,24 @@ namespace System.Reflection {
 
                protected override bool IsPointerImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.IsPointerImpl ();
+                       return typeImpl.IsPointer;
                }
 
                protected override bool IsPrimitiveImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.IsPrimitiveImpl ();
+                       return typeImpl.IsPrimitive;
                }
 
                protected override bool IsValueTypeImpl()
                {
-                       throw new NotImplementedException ();
-                       //return typeImpl.IsValueTypeImpl ();
-               }
-#if NET_2_0 | BOOTSTRAP_NET_2_0
-               public override Type[] GetGenericArguments ()
-               {
-                       throw new NotImplementedException ();
-               }
-
-               public override bool HasGenericArguments {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               public override bool ContainsGenericParameters {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               public override bool IsGenericParameter {
-                       get {
-                               throw new NotImplementedException ();
-                       }
-               }
-
-               public override int GenericParameterPosition {
-                       get {
-                               throw new NotImplementedException ();
-                       }
+                       return typeImpl.IsValueType;
                }
 
-               public override MethodInfo DeclaringMethod {
+               public override int MetadataToken {
                        get {
-                               throw new NotImplementedException ();
+                               return typeImpl.MetadataToken;
                        }
                }
-#endif
 
        }
 }