diff options
author | Iain McCoy <iainmc@mono-cvs.ximian.com> | 2005-07-14 20:38:43 +0400 |
---|---|---|
committer | Iain McCoy <iainmc@mono-cvs.ximian.com> | 2005-07-14 20:38:43 +0400 |
commit | c6e26321fa64f1b15e4f2d561079968d3452f7b3 (patch) | |
tree | 874e37ab8427412bc94ea6a76ef50a449ec6cd91 | |
parent | 32d2f2d1bddfe6e7b3c3ff4141b77aeef2256020 (diff) |
2005-07-15 Iain McCoy <iain@mccoy.id.au>
* 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
svn path=/trunk/mcs/; revision=47310
-rw-r--r-- | mcs/class/PresentationFramework/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs | 2 | ||||
-rw-r--r-- | mcs/tools/xamlc/ChangeLog | 8 | ||||
-rw-r--r-- | mcs/tools/xamlc/demo/Makefile | 2 | ||||
-rw-r--r-- | mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs | 14 | ||||
-rw-r--r-- | mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs | 14 | ||||
-rw-r--r-- | mcs/tools/xamlc/demo/test.xaml | 4 |
7 files changed, 37 insertions, 12 deletions
diff --git a/mcs/class/PresentationFramework/ChangeLog b/mcs/class/PresentationFramework/ChangeLog index 811d9a4a5d2..35d15bee2e2 100644 --- a/mcs/class/PresentationFramework/ChangeLog +++ b/mcs/class/PresentationFramework/ChangeLog @@ -1,5 +1,10 @@ 2005-07-15 Iain McCoy <iain@mccoy.id.au> + * Mono.Windows.Serialization/CodeWriter.cs: don't try to convert + objects into their parent types. + +2005-07-15 Iain McCoy <iain@mccoy.id.au> + * Mono.Windows.Serialization/CodeWriter.cs: Better debugging information * Mono.Windows.Serialization/XamlParser.cs: Better debugging diff --git a/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs b/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs index 00ab7bd0bcf..bf5fc697676 100644 --- a/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs +++ b/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs @@ -325,7 +325,7 @@ namespace Mono.Windows.Serialization { CodeExpression expr; - if (destType == sourceType) + if (sourceType == destType || sourceType.IsSubclassOf(destType)) expr = varRef; else expr = new CodeCastExpression( diff --git a/mcs/tools/xamlc/ChangeLog b/mcs/tools/xamlc/ChangeLog index c7ba34dbfaf..7978e41854d 100644 --- a/mcs/tools/xamlc/ChangeLog +++ b/mcs/tools/xamlc/ChangeLog @@ -1,5 +1,13 @@ 2005-07-15 Iain McCoy <iain@mccoy.id.au> + * 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 <iain@mccoy.id.au> + * demo/test.xaml: uncommented second test of complex objects as property values diff --git a/mcs/tools/xamlc/demo/Makefile b/mcs/tools/xamlc/demo/Makefile index 89ac4bd7329..9debad88d23 100644 --- a/mcs/tools/xamlc/demo/Makefile +++ b/mcs/tools/xamlc/demo/Makefile @@ -8,7 +8,7 @@ run: 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 diff --git a/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs b/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs index 8f7648bf649..22929673097 100644 --- a/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs +++ b/mcs/tools/xamlc/demo/TestVocab/ConsoleValue.cs @@ -52,6 +52,20 @@ namespace Xaml.TestVocab.Console { } } + 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() diff --git a/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs b/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs index 9d2e9d63dcf..465b78c36e9 100644 --- a/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs +++ b/mcs/tools/xamlc/demo/TestVocab/ConsoleWriter.cs @@ -6,20 +6,20 @@ namespace Xaml.TestVocab.Console { 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 @@ namespace Xaml.TestVocab.Console { 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); diff --git a/mcs/tools/xamlc/demo/test.xaml b/mcs/tools/xamlc/demo/test.xaml index 785f1f697f3..d965c86cad4 100644 --- a/mcs/tools/xamlc/demo/test.xaml +++ b/mcs/tools/xamlc/demo/test.xaml @@ -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> |