]> O.S.I.I.S - jp/crow.git/commitdiff
typo and debug
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 16 Sep 2015 13:18:27 +0000 (15:18 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 16 Sep 2015 13:18:27 +0000 (15:18 +0200)
src/GraphicObjects/TemplatedContainer.cs
src/OpenTKGameWindow.cs

index a19f6c282006cf2f091e846dabd53a6706187f97..56217419e6695dc539fd144b063c131d6f3b62d6 100644 (file)
@@ -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
        }
 }
 
index bc1ebda931d314c38e21d6c69ab16643de73e2e6..ff1ffeedc33132d50689e2fc47adfa577dc6865c 100755 (executable)
@@ -92,11 +92,13 @@ namespace go
                /// <summary> Remove all Graphic objects from top container </summary>\r
                public void ClearInterface()\r
                {\r
-                       foreach (GraphicObject g in GraphicObjects) {\r
+                       int i = 0;\r
+                       while (GraphicObjects.Count>0) {\r
+                               GraphicObject g = GraphicObjects [i];\r
                                g.Visible = false;\r
                                g.ClearBinding ();\r
+                               GraphicObjects.RemoveAt (0);\r
                        }\r
-                       GraphicObjects.Clear ();\r
                }\r
                public void Quit ()\r
                {\r