2007-09-27 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 27 Sep 2007 18:10:32 +0000 (18:10 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 27 Sep 2007 18:10:32 +0000 (18:10 -0000)
* TypeDescriptor.cs : added missing ObsoleteAttribute.
* MemberDescriptor.cs, PropertyDescriptor.cs :
  implemented GetInvocationTarget().

svn path=/trunk/mcs/; revision=86524

mcs/class/System/System.ComponentModel/ChangeLog
mcs/class/System/System.ComponentModel/MemberDescriptor.cs
mcs/class/System/System.ComponentModel/PropertyDescriptor.cs
mcs/class/System/System.ComponentModel/TypeDescriptor.cs

index ec7d01ed94323bec9669298f70d326be5ea32803..cafb41da5db0c4c1acb94a7e6ac6ff17962abc30 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * TypeDescriptor.cs : added missing ObsoleteAttribute.
+       * MemberDescriptor.cs, PropertyDescriptor.cs :
+         implemented GetInvocationTarget().
+
 2007-09-25  Jonathan Pobst  <monkey@jpobst.com>
 
        * AsyncOperationManager.cs: Tie the SynchronizationContext here to
index 0df1f98e497b25348a1c0dc97c2c3ba016778f63..85b691bce426fd06c986036e9768b058cf25b1f1 100644 (file)
@@ -220,9 +220,9 @@ namespace System.ComponentModel
                 return null;
         }
 
-//#if NET_2_0 // uncomment when it is implemented
-//     [Obsolete ("Use GetInvocationTarget")]
-//#endif
+#if NET_2_0 // uncomment when it is implemented
+       [Obsolete ("Use GetInvocationTarget")]
+#endif
         protected static object GetInvokee(Type componentClass, object component)
         {
                if (component is IComponent) {
@@ -241,10 +241,14 @@ namespace System.ComponentModel
         }
 
 #if NET_2_0
-               [MonoNotSupported("")]
                protected virtual object GetInvocationTarget (Type type, object instance)
                {
-                       throw new NotImplementedException ();
+                       if (type == null)
+                               throw new ArgumentNullException ("type");
+                       if (instance == null)
+                               throw new ArgumentNullException ("instance");
+
+                       return GetInvokee (type, instance);
                }
 #endif
 
index 43d883cb51ff10c27245e38a9663175f744133f6..452ce1bd46d539d022f1350097a05a40b058e573 100644 (file)
@@ -171,9 +171,18 @@ namespace System.ComponentModel
                        base.FillAttributes (attributeList);
                }
 
-               [MonoNotSupported ("")]
-               protected override Object GetInvocationTarget (Type type, object instance)
+               protected override object GetInvocationTarget (Type type, object instance)
                {
+                       if (type == null)
+                               throw new ArgumentNullException ("type");
+                       if (instance == null)
+                               throw new ArgumentNullException ("instance");
+
+                       if (instance is CustomTypeDescriptor) {
+                               CustomTypeDescriptor ctd = (CustomTypeDescriptor) instance;
+                               return ctd.GetPropertyOwner (this);
+                       }
+
                        return base.GetInvocationTarget (type, instance);
                }
 
index e5df6e535f15ae072cba76a1a0813567f07f31d2..202909836fdcd9cfc62753202f058a32f318ad11 100644 (file)
@@ -775,6 +775,10 @@ public sealed class TypeDescriptor
                        infos.Add (ob);
        }
 
+#if NET_2_0
+       // well, ComObjectType is not implemented, but we don't support COM anyways ...
+       [Obsolete ("Use ComObjectType")]
+#endif
        public static IComNativeDescriptorHandler ComNativeDescriptorHandler {
                [PermissionSet (SecurityAction.LinkDemand, Unrestricted = true)]
                get { return descriptorHandler; }