Пример #1
0
        public void Load(XmlElement xmlElem)
        {
            XmlNodeList nodes = xmlElem.GetElementsByTagName("graphic");

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode node = nodes[i];
                if (node is XmlElement)
                {
                    XmlElement      elem    = (XmlElement)node;
                    StrategyGraphic graphic = new StrategyGraphic();
                    graphic.Load(elem);
                    this.AddGraphic(graphic);
                }
            }
        }
Пример #2
0
        public void TestStrategyGraphicSaveLoad()
        {
            StrategyGraphic graphic = GetGraphic();

            Console.WriteLine(XmlUtils.ToString(graphic));

            XmlDocument doc  = new XmlDocument();
            XmlElement  root = doc.CreateElement("root");

            doc.AppendChild(root);
            graphic.Save(root);

            StrategyGraphic graphic2 = new StrategyGraphic();

            graphic2.Load(root);
            Console.WriteLine(XmlUtils.ToString(graphic2));

            Assert.AreEqual(XmlUtils.ToString(graphic), XmlUtils.ToString(graphic2));
        }
Пример #3
0
 public void Load(XmlElement xmlElem)
 {
     this.startBarPos = int.Parse(xmlElem.GetAttribute("startBarPos"));
     strategyGraphic  = new StrategyGraphic();
     strategyGraphic.Load(xmlElem);
 }