aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/IMLStream.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-08-06 17:48:03 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2016-08-06 17:48:03 +0200
commitc45ce80e0e4298afcbeee9215ee2d1d30c4c3be8 (patch)
treeec659a28153b9df8406736d9f8df6ee255b8cb7e /src/IMLStream.cs
parentf42cabddc008529eddc0a43cad3be2b39b6790ee (diff)
* Crow.csproj:
* Label.cs: update * GraphicObject.cs: key up * ListBox.cs: IMLStream instanciing * PrivateContainer.cs: Clear child Changes * Scroller.cs: scroller have VerticalSrcrolling by default * TemplatedControl.cs: remove unused hostClass attribute * IMLStream.cs: IMLStream instance and source properties * Interface.cs: removed unused hostClass Only putOnTop Window widget when focused KeyboardState key up and down * TreeView.crow: no border in default template * BasicTests.cs: IMLEditor PropLessBinding test * Tests.csproj: * 2.crow: * 0.crow: * test5.crow: * 2.crow: * testTreeView.crow: update tests * Bindings.cs: * MemberReference.cs: * CompilerServices.cs: property less bindings debug
Diffstat (limited to 'src/IMLStream.cs')
-rw-r--r--src/IMLStream.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/IMLStream.cs b/src/IMLStream.cs
index ccc09f45..d4dc6496 100644
--- a/src/IMLStream.cs
+++ b/src/IMLStream.cs
@@ -37,6 +37,25 @@ namespace Crow
public IMLStream(Byte[] b) : base (b){
RootType = Interface.GetTopContainerOfXMLStream (this);
}
+ /// <summary>
+ /// Create a graphicObject instance from the this XML stream.
+ /// </summary>
+ public GraphicObject Instance {
+ get {
+ Seek (0, SeekOrigin.Begin);
+ return Interface.Load (this, this.RootType);
+ }
+ }
+ /// <summary>
+ /// Gets the xml source code as a string
+ /// </summary>
+ public string Source {
+ get {
+ Seek (0, SeekOrigin.Begin);
+ using (StreamReader sr = new StreamReader(this))
+ return sr.ReadToEnd();
+ }
+ }
}
public class ItemTemplate : IMLStream {
public EventHandler Expand;