Author: iainmc
Date: 2005-07-14 12:38:43 -0400 (Thu, 14 Jul 2005)
New Revision: 47310

Modified:
   trunk/mcs/class/PresentationFramework/ChangeLog
   
trunk/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs
   trunk/mcs/tools/xamlc/ChangeLog
   trunk/mcs/tools/xamlc/demo/Makefile
   trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs
   trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs
   trunk/mcs/tools/xamlc/demo/test.xaml
Log:
2005-07-15  Iain McCoy  <[EMAIL PROTECTED]>

        * Mono.Windows.Serialization/CodeWriter.cs: don't try to convert
        objects into their parent types.
        * demo/TestVocab/ConsoleValues.cs: Add ConsoleValueAppend to avoid
        resolving read value too early
        * demo/TestVocab/ConsoleWriter.cs: Use ConsoleValue as type of Text
        property. These changes get the example working



Modified: trunk/mcs/class/PresentationFramework/ChangeLog
===================================================================
--- trunk/mcs/class/PresentationFramework/ChangeLog     2005-07-14 16:06:34 UTC 
(rev 47309)
+++ trunk/mcs/class/PresentationFramework/ChangeLog     2005-07-14 16:38:43 UTC 
(rev 47310)
@@ -1,5 +1,10 @@
 2005-07-15  Iain McCoy  <[EMAIL PROTECTED]>
 
+       * Mono.Windows.Serialization/CodeWriter.cs: don't try to convert
+       objects into their parent types.
+
+2005-07-15  Iain McCoy  <[EMAIL PROTECTED]>
+
        * Mono.Windows.Serialization/CodeWriter.cs: Better debugging
        information
        * Mono.Windows.Serialization/XamlParser.cs: Better debugging

Modified: 
trunk/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs
===================================================================
--- 
trunk/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs  
    2005-07-14 16:06:34 UTC (rev 47309)
+++ 
trunk/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs  
    2005-07-14 16:38:43 UTC (rev 47310)
@@ -325,7 +325,7 @@
 
                        
                        CodeExpression expr;
-                       if (destType == sourceType)
+                       if (sourceType == destType || 
sourceType.IsSubclassOf(destType))
                                expr = varRef;
                        else
                                expr = new CodeCastExpression(

Modified: trunk/mcs/tools/xamlc/ChangeLog
===================================================================
--- trunk/mcs/tools/xamlc/ChangeLog     2005-07-14 16:06:34 UTC (rev 47309)
+++ trunk/mcs/tools/xamlc/ChangeLog     2005-07-14 16:38:43 UTC (rev 47310)
@@ -1,5 +1,13 @@
 2005-07-15  Iain McCoy  <[EMAIL PROTECTED]>
 
+       * demo/TestVocab/ConsoleValues.cs: Add ConsoleValueAppend to avoid
+       resolving read value too early
+       * demo/TestVocab/ConsoleWriter.cs: Use ConsoleValue as type of Text
+       property. These changes get the example working
+
+
+2005-07-15  Iain McCoy  <[EMAIL PROTECTED]>
+
        * demo/test.xaml: uncommented second test of complex objects as
        property values
 

Modified: trunk/mcs/tools/xamlc/demo/Makefile
===================================================================
--- trunk/mcs/tools/xamlc/demo/Makefile 2005-07-14 16:06:34 UTC (rev 47309)
+++ trunk/mcs/tools/xamlc/demo/Makefile 2005-07-14 16:38:43 UTC (rev 47310)
@@ -8,7 +8,7 @@
        make TestVocab.dll
        MONO_PATH="." $(RUNTIME) --debug ../xamlc.exe -o:test.xaml.out.cs 
test.xaml
        $(CSCOMPILE) -r:TestVocab.dll -o test.exe test.xaml.out.cs
-       $(RUNTIME) --debug test.exe
+       echo "INPUTINPUT" | $(RUNTIME) --debug test.exe
 
 run2:
        make runtimetest.exe

Modified: trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs
===================================================================
--- trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs        2005-07-14 
16:06:34 UTC (rev 47309)
+++ trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs        2005-07-14 
16:38:43 UTC (rev 47310)
@@ -52,6 +52,20 @@
                }
        }
 
+       public class ConsoleValueAppend : ConsoleValue {
+               ConsoleValue a, b;
+               public ConsoleValueAppend(ConsoleValue a, ConsoleValue b)
+               {
+                       this.a = a;
+                       this.b = b;
+               }
+
+               public override string Value {
+                       get { return a.Value + b.Value; }
+               }
+       }
+
+
        public class ConsoleValueVar : ConsoleValue {
                string var;
                public ConsoleValueVar()

Modified: trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs
===================================================================
--- trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs       2005-07-14 
16:06:34 UTC (rev 47309)
+++ trunk/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs       2005-07-14 
16:38:43 UTC (rev 47310)
@@ -6,20 +6,20 @@
        public delegate string Filter(string s);
        
        public class ConsoleWriter : DependencyObject, IAddChild, 
IConsoleAction {
-               string text;
+               ConsoleValue text;
                private Filter filter;
 
                public ConsoleWriter()
                {
-                       text = "";
+                       text = new ConsoleValueString("");
                }
                
                public ConsoleWriter(ConsoleValue text)
                {
-                       this.text = text.Value;
+                       this.text = text;
                }
 
-               public string Text {
+               public ConsoleValue Text {
                        get { return text; }
                        set { text = value; }
                }
@@ -30,19 +30,19 @@
 
                public void AddText(string text)
                {
-                       this.text += text;
+                       this.text = new ConsoleValueAppend(this.text, new 
ConsoleValueString(text));
                }
 
                public void AddChild(Object o)
                {
-                       this.text += ((ConsoleValue)o).Value;
+                       this.text = new ConsoleValueAppend(this.text, 
(ConsoleValue)o);
                }
 
                
                public void Run()
                {
                        Filter f = filter;
-                       string s = text;
+                       string s = text.Value;
                        // apply filter, if it exists
                        if (f != null)
                                s = f(s);

Modified: trunk/mcs/tools/xamlc/demo/test.xaml
===================================================================
--- trunk/mcs/tools/xamlc/demo/test.xaml        2005-07-14 16:06:34 UTC (rev 
47309)
+++ trunk/mcs/tools/xamlc/demo/test.xaml        2005-07-14 16:38:43 UTC (rev 
47310)
@@ -13,9 +13,7 @@
                </ConsoleReader.Prompt>
        </ConsoleReader>
        <ConsoleWriter>
-               <ConsoleWriter.Text>
-                       <ConsoleValueVar Variable="thingo" />
-               </ConsoleWriter.Text>
+               <ConsoleWriter.Text>I say: <ConsoleValueVar Variable="thingo" 
/></ConsoleWriter.Text>
        </ConsoleWriter>
        <ConsoleWriter>
                <ConsoleApp.Repetitions>3</ConsoleApp.Repetitions>

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

Reply via email to