diff options
Diffstat (limited to 'src/IMLStream.cs')
| -rw-r--r-- | src/IMLStream.cs | 19 |
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; |