diff options
author | Iain McCoy <iainmc@mono-cvs.ximian.com> | 2005-07-18 20:29:06 +0400 |
---|---|---|
committer | Iain McCoy <iainmc@mono-cvs.ximian.com> | 2005-07-18 20:29:06 +0400 |
commit | c063abca55521fb1fd7e03ffd98adfc2b4898b12 (patch) | |
tree | dd4d0913c9a65e50881a5ced20678fb01736b7ad /mcs/class/PresentationFramework | |
parent | e58d1ac64815170598fee921f87b7502b3e51bf9 (diff) |
2005-07-18 Iain McCoy <iain@mccoy.id.au>
* Mono.Windows.Serialization/*, Test/*: change stupid
CreateElementText name of method on XamlWriter to something marginally
more sensible
* demo/TestVocab/*.cs: add implementations of equals so that tests for
the ObjectWriter can be written.
2005-07-19 Iain McCoy <iain@mccoy.id.au>
* System.Windows/DependencyObject.cs,
System.Windows/LocalValueEnumerator.cs: implemented
GetLocalValueEnumerator() and the LocalValueEnumerator class to
support it.
* Test/DependencyObject.cs: added test for LocalValueEnumerator
svn path=/trunk/mcs/; revision=47391
Diffstat (limited to 'mcs/class/PresentationFramework')
8 files changed, 30 insertions, 24 deletions
diff --git a/mcs/class/PresentationFramework/ChangeLog b/mcs/class/PresentationFramework/ChangeLog index dde05e844d3..3540ec9b06d 100644 --- a/mcs/class/PresentationFramework/ChangeLog +++ b/mcs/class/PresentationFramework/ChangeLog @@ -1,5 +1,11 @@ 2005-07-18 Iain McCoy <iain@mccoy.id.au> + * Mono.Windows.Serialization/*, Test/*: change stupid + CreateElementText name of method on XamlWriter to something marginally + more sensible + +2005-07-18 Iain McCoy <iain@mccoy.id.au> + * Mono.Windows.Serialization/CodeWriter.cs, Test/CodeWriter.cs Test/XamlWriter.cs: fix bug with explicitly naming objects in diff --git a/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs b/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs index e35c8684c54..b7c93d0a492 100644 --- a/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs +++ b/mcs/class/PresentationFramework/Mono.Windows.Serialization/CodeWriter.cs @@ -35,7 +35,7 @@ using System.CodeDom; using System.CodeDom.Compiler; namespace Mono.Windows.Serialization { - public class CodeWriter : XamlWriter { + public class CodeWriter : IXamlWriter { TextWriter writer; ICodeGenerator generator; bool isPartial; @@ -199,7 +199,7 @@ namespace Mono.Windows.Serialization { } // top of stack must be an object reference - public void CreateElementText(string text) + public void CreateObjectText(string text) { debug(); CodeVariableReferenceExpression var = (CodeVariableReferenceExpression)objects[objects.Count - 1]; diff --git a/mcs/class/PresentationFramework/Mono.Windows.Serialization/ObjectWriter.cs b/mcs/class/PresentationFramework/Mono.Windows.Serialization/ObjectWriter.cs index 90ceab11270..f8c283cfbfc 100644 --- a/mcs/class/PresentationFramework/Mono.Windows.Serialization/ObjectWriter.cs +++ b/mcs/class/PresentationFramework/Mono.Windows.Serialization/ObjectWriter.cs @@ -36,7 +36,7 @@ using System.ComponentModel; using System.Windows.Serialization; namespace Mono.Windows.Serialization { - public class ObjectWriter : XamlWriter { + public class ObjectWriter : IXamlWriter { public object instance; ArrayList objects = new ArrayList(); @@ -81,7 +81,7 @@ namespace Mono.Windows.Serialization { setter.Invoke(null, new object[] { objects[objects.Count - 1], value}); } - public void CreateElementText(string text) + public void CreateObjectText(string text) { ((IAddChild)objects[objects.Count - 1]).AddText(text); } diff --git a/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs b/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs index ad726c84519..0d2d6f4af11 100644 --- a/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs +++ b/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlParser.cs @@ -41,7 +41,7 @@ namespace Mono.Windows.Serialization { public const string XAML_NAMESPACE = "http://schemas.microsoft.com/winfx/xaml/2005"; private Mapper mapper = new Mapper(new string[] { }); private XmlReader reader; - private XamlWriter writer; + private IXamlWriter writer; private enum CurrentType { Object, Property, @@ -59,17 +59,17 @@ namespace Mono.Windows.Serialization { private ParserState currentState = null; private ArrayList oldStates = new ArrayList(); - public XamlParser(string filename, XamlWriter writer) : this( + public XamlParser(string filename, IXamlWriter writer) : this( new XmlTextReader(filename), writer) { } - public XamlParser(TextReader reader, XamlWriter writer) : this( + public XamlParser(TextReader reader, IXamlWriter writer) : this( new XmlTextReader(reader), writer) { } - public XamlParser(XmlReader reader, XamlWriter writer) + public XamlParser(XmlReader reader, IXamlWriter writer) { this.reader = reader; this.writer = writer; @@ -201,7 +201,7 @@ namespace Mono.Windows.Serialization { case CurrentType.Object: case CurrentType.PropertyObject: abortIfNotAddChild("text"); - writer.CreateElementText(reader.Value); + writer.CreateObjectText(reader.Value); break; case CurrentType.DependencyProperty: DependencyProperty dp = (DependencyProperty)currentState.obj; diff --git a/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlWriter.cs b/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlWriter.cs index 5de3c224985..1a3869a703a 100644 --- a/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlWriter.cs +++ b/mcs/class/PresentationFramework/Mono.Windows.Serialization/XamlWriter.cs @@ -30,11 +30,11 @@ using System; using System.Reflection; namespace Mono.Windows.Serialization { - public interface XamlWriter { + public interface IXamlWriter { void CreateTopLevel(Type parent, string className); void CreateObject(Type type, string name); - void CreateElementText(string text); + void CreateObjectText(string text); void EndObject(); void CreateProperty(PropertyInfo property); diff --git a/mcs/class/PresentationFramework/PresentationFramework.dll.sources b/mcs/class/PresentationFramework/PresentationFramework.dll.sources index a39ed38938a..d3db2b1a460 100644 --- a/mcs/class/PresentationFramework/PresentationFramework.dll.sources +++ b/mcs/class/PresentationFramework/PresentationFramework.dll.sources @@ -5,5 +5,5 @@ Mono.Windows.Serialization/CodeWriter.cs Mono.Windows.Serialization/ObjectWriter.cs Mono.Windows.Serialization/Exceptions.cs Mono.Windows.Serialization/XamlParser.cs -Mono.Windows.Serialization/XamlWriter.cs +Mono.Windows.Serialization/IXamlWriter.cs Assembly/AssemblyInfo.cs diff --git a/mcs/class/PresentationFramework/Test/CodeWriter.cs b/mcs/class/PresentationFramework/Test/CodeWriter.cs index 2554fd28b78..976f288981c 100644 --- a/mcs/class/PresentationFramework/Test/CodeWriter.cs +++ b/mcs/class/PresentationFramework/Test/CodeWriter.cs @@ -152,7 +152,7 @@ public class CodeWriterTest { { cw.CreateTopLevel(typeof(ConsoleApp), null); cw.CreateObject(typeof(ConsoleWriter), null); - cw.CreateElementText("Hello"); + cw.CreateObjectText("Hello"); cw.EndObject(); cw.EndObject(); cw.Finish(); diff --git a/mcs/class/PresentationFramework/Test/XamlParser.cs b/mcs/class/PresentationFramework/Test/XamlParser.cs index 8e77a3df458..13e497f5dcf 100644 --- a/mcs/class/PresentationFramework/Test/XamlParser.cs +++ b/mcs/class/PresentationFramework/Test/XamlParser.cs @@ -34,9 +34,9 @@ // tells the code generator to do what you'd expect. This tests both the parsing // and type-checking bits of XamlParser. // -// The various Happening classes each represent methods on the XamlWriter +// The various Happening classes each represent methods on the IXamlWriter // interface that XamlParser could call. The constructor of a Happening takes -// the same arguments as the XamlWriter method it represents, and merely stashes +// the same arguments as the IXamlWriter method it represents, and merely stashes // those values in the suitable public fields. // // The ParserTester class takes a Xaml document and a list of Happenings, and @@ -203,7 +203,7 @@ public class XamlParserTest : Assertion { ParserTester pt = new ParserTester(MAPPING + s, new CreateTopLevelHappening(typeof(ConsoleApp), null), new CreateObjectHappening(typeof(ConsoleWriter), null), - new CreateElementTextHappening("Hello"), + new CreateObjectTextHappening("Hello"), new EndObjectHappening(), new EndObjectHappening(), new FinishHappening()); @@ -442,7 +442,7 @@ public class XamlParserTest : Assertion { ParserTester pt = new ParserTester(MAPPING + s, new CreateTopLevelHappening(typeof(ConsoleApp), null), new CreateObjectHappening(typeof(ConsoleValueString), null), - new CreateElementTextHappening("xyz"), + new CreateObjectTextHappening("xyz"), new EndObjectHappening(), new EndObjectHappening(), new EndObjectHappening(), @@ -477,10 +477,10 @@ class CreateObjectHappening : Happening } } -class CreateElementTextHappening : Happening +class CreateObjectTextHappening : Happening { public string text; - public CreateElementTextHappening(string text) { + public CreateObjectTextHappening(string text) { this.text = text; } } @@ -580,7 +580,7 @@ class FinishHappening : Happening } -class ParserTester : XamlWriter { +class ParserTester : IXamlWriter { string document; Happening[] happenings; int c; @@ -640,11 +640,11 @@ class ParserTester : XamlWriter { Assert.AreEqual(h.objectName, objectName); } - public void CreateElementText(string text){ - d("CreateElementText"); - AssertSubclass(typeof(CreateElementTextHappening), false); + public void CreateObjectText(string text){ + d("CreateObjectText"); + AssertSubclass(typeof(CreateObjectTextHappening), false); - CreateElementTextHappening h = (CreateElementTextHappening)getHappening(); + CreateObjectTextHappening h = (CreateObjectTextHappening)getHappening(); Assert.AreEqual(h.text, text); } |