dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel TypeConverter.c


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System/ComponentModel TypeConverter.cs, 1.9, 1.10
Date: Tue, 16 Sep 2003 19:21:45 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel
In directory subversions:/tmp/cvs-serv14992/System/ComponentModel

Modified Files:
        TypeConverter.cs 
Log Message:


Add support for instance descriptors to "ConvertFrom" and "CanConvertFrom".


Index: TypeConverter.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/ComponentModel/TypeConverter.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** TypeConverter.cs    16 Sep 2003 05:25:31 -0000      1.9
--- TypeConverter.cs    16 Sep 2003 23:21:43 -0000      1.10
***************
*** 29,32 ****
--- 29,33 ----
  using System.Globalization;
  using System.Runtime.InteropServices;
+ using System.ComponentModel.Design.Serialization;
  
  [ComVisible(true)]
***************
*** 47,51 ****
--- 48,57 ----
                                (ITypeDescriptorContext context, Type 
sourceType)
                        {
+                       #if CONFIG_COMPONENT_MODEL_DESIGN
+                               // By default, we can always convert instance 
descriptors.
+                               return (sourceType == 
typeof(InstanceDescriptor));
+                       #else
                                return false;
+                       #endif
                        }
  
***************
*** 71,74 ****
--- 77,86 ----
                                                                          
Object value)
                        {
+                       #if CONFIG_COMPONENT_MODEL_DESIGN
+                               if(value is InstanceDescriptor)
+                               {
+                                       return 
((InstanceDescriptor)value).Invoke();
+                               }
+                       #endif
                                throw GetConvertFromException(value);
                        }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]