Author: zoltan
Date: 2007-09-22 12:50:34 -0400 (Sat, 22 Sep 2007)
New Revision: 86219

Modified:
   trunk/olive/class/agclr/Mono/ChangeLog
   trunk/olive/class/agclr/Mono/ManagedXamlLoader.cs
Log:
2007-09-22  Zoltan Varga  <[EMAIL PROTECTED]>

        * ManagedXamlLoader.cs (load_file): Load the source using 
Moonlight.LoadResource.


Modified: trunk/olive/class/agclr/Mono/ChangeLog
===================================================================
--- trunk/olive/class/agclr/Mono/ChangeLog      2007-09-22 16:50:02 UTC (rev 
86218)
+++ trunk/olive/class/agclr/Mono/ChangeLog      2007-09-22 16:50:34 UTC (rev 
86219)
@@ -1,8 +1,10 @@
 2007-09-22  Zoltan Varga  <[EMAIL PROTECTED]>
 
+       * ManagedXamlLoader.cs (load_file): Load the source using 
Moonlight.LoadResource.
+       
        * ManagedXamlLoader.cs: Call Moonlight.LoadFile so the desktop code in 
mopen.cs
        can take control of assembly loading.
-       
+
        * ManagedXamlLoader.cs: Add a new load_code callback.
 
 2007-09-22  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 

Modified: trunk/olive/class/agclr/Mono/ManagedXamlLoader.cs
===================================================================
--- trunk/olive/class/agclr/Mono/ManagedXamlLoader.cs   2007-09-22 16:50:02 UTC 
(rev 86218)
+++ trunk/olive/class/agclr/Mono/ManagedXamlLoader.cs   2007-09-22 16:50:34 UTC 
(rev 86219)
@@ -30,6 +30,7 @@
 using System;
 using System.Reflection;
 using System.Collections;
+using System.IO;
 using System.Windows;
 using System.Windows.Controls;
 using Mono;
@@ -344,6 +345,25 @@
                private void load_code (string source, string type)
                {
                        Console.WriteLine ("ManagedXamlLoader.load_code: '" + 
source + "' '" + type + "'");
+
+                       if (source == null) {
+                               Console.WriteLine 
("ManagedXamlLoader.load_code: ERROR: Source can't be null.");
+                               return;
+                       }
+
+                       Stream s = null;
+                       try {
+                               s = Moonlight.LoadResource (source);
+                       }
+                       catch (Exception ex) {
+                               Console.WriteLine 
("ManagedXamlLoader.load_code: ERROR: LoadResource failed: '" + ex + "'");
+                               return;
+                       }
+
+                       if (s == null) {
+                               Console.WriteLine 
("ManagedXamlLoader.load_code: ERROR: Source file cannot be loaded.");
+                               return;
+                       }
                }
        }
 }

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

Reply via email to