aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
-rw-r--r--src/GraphicObjects/TemplatedContainer.cs18
-rwxr-xr-xsrc/OpenTKGameWindow.cs6
2 files changed, 17 insertions, 7 deletions
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
/// <summary> Remove all Graphic objects from top container </summary>
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 ()
{