Author: miguel
Date: 2007-06-30 19:46:42 -0400 (Sat, 30 Jun 2007)
New Revision: 81133

Modified:
   trunk/olive/class/agclr/System.Windows/XamlReader.cs
Log:
Small debugging helpers to track a few bugs

Modified: trunk/olive/class/agclr/System.Windows/XamlReader.cs
===================================================================
--- trunk/olive/class/agclr/System.Windows/XamlReader.cs        2007-06-30 
23:45:34 UTC (rev 81132)
+++ trunk/olive/class/agclr/System.Windows/XamlReader.cs        2007-06-30 
23:46:42 UTC (rev 81133)
@@ -92,12 +92,17 @@
                        if (ns != null)
                                name = String.Concat (ns, ".", name);
 
-                       DependencyObject res = (DependencyObject) 
clientlib.CreateInstance (name);
-
-                       if (res == null) {
+                       Console.WriteLine ("create");
+                       object r = clientlib.CreateInstance (name);
+                       if (r == null){
                                Console.WriteLine ("unable to create object 
instance:  '{0}'", name);
                                return IntPtr.Zero;
                        }
+                       DependencyObject res = r as DependencyObject;
+                       if (res == null){
+                               Console.WriteLine ("Object is not a dependency 
object:  '{0}'", r.GetType ());
+                               return IntPtr.Zero;
+                       }
 
                        IntPtr p = Hosting.GetNativeObject (res);
                        return p;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to