From: jpbruyere Date: Wed, 16 Sep 2015 13:18:27 +0000 (+0200) Subject: typo and debug X-Git-Tag: 0.2~3 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=6847840a3bc4b4df9bfdceea0f5ed80c9e109b91;p=jp%2Fcrow.git typo and debug --- diff --git a/src/GraphicObjects/TemplatedContainer.cs b/src/GraphicObjects/TemplatedContainer.cs index a19f6c28..56217419 100644 --- a/src/GraphicObjects/TemplatedContainer.cs +++ b/src/GraphicObjects/TemplatedContainer.cs @@ -26,15 +26,19 @@ namespace go { public abstract class TemplatedContainer : TemplatedControl { + #region CTOR + public TemplatedContainer () : base(){} + #endregion + [XmlIgnore]public abstract GraphicObject Content{ get; set;} - protected override void loadTemplate (GraphicObject template) + #region GraphicObject overrides + public override void ClearBinding () { - base.loadTemplate (template); - } + if (Content != null) + Content.ClearBinding (); - public TemplatedContainer () : base() - { + base.ClearBinding (); } public override GraphicObject FindByName (string nameToFind) { @@ -43,6 +47,9 @@ namespace go return Content == null ? null : Content.FindByName (nameToFind); } + #endregion + + #region IXmlSerialisation Overrides public override void ReadXml(System.Xml.XmlReader reader) { using (System.Xml.XmlReader subTree = reader.ReadSubtree ()) { @@ -90,6 +97,7 @@ namespace go (Content as IXmlSerializable).WriteXml(writer); writer.WriteEndElement(); } + #endregion } } diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs index bc1ebda9..ff1ffeed 100755 --- a/src/OpenTKGameWindow.cs +++ b/src/OpenTKGameWindow.cs @@ -92,11 +92,13 @@ namespace go /// Remove all Graphic objects from top container public void ClearInterface() { - foreach (GraphicObject g in GraphicObjects) { + int i = 0; + while (GraphicObjects.Count>0) { + GraphicObject g = GraphicObjects [i]; g.Visible = false; g.ClearBinding (); + GraphicObjects.RemoveAt (0); } - GraphicObjects.Clear (); } public void Quit () {