Exemplo n.º 1
0
        public void TestShapeContainerManager()
        {
            PriceShapeContainerManager manager = new PriceShapeContainerManager();

            KLineKey            klineKey  = new KLineKey("rb1710", 20170105, 20170501, KLinePeriod.KLinePeriod_15Minute);
            PriceShapeContainer container = new PriceShapeContainer_KLine(klineKey);

            TestShapeContainer.GetContainer(container);
            manager.AddContainer(container);

            TimeLineKey         timeLineKey = new TimeLineKey("rb1710", 20170107);
            PriceShapeContainer container2  = new PriceShapeContainer_TimeLine(timeLineKey);

            TestShapeContainer.GetContainer(container2);
            manager.AddContainer(container2);

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

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

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

            PriceShapeContainerManager manager2 = new PriceShapeContainerManager();

            manager2.Load(root);
            Assert.AreEqual(1, manager2.GetKLineKeies().Count);
            Assert.AreEqual(1, manager2.GetTimeLineKeies().Count);

            Assert.IsNotNull(manager2.GetShapeContainer(klineKey));
            Assert.IsNotNull(manager2.GetShapeContainer(timeLineKey));

            Assert.AreEqual(XmlUtils.ToString(manager), XmlUtils.ToString(manager2));
        }
Exemplo n.º 2
0
 public override void Load(XmlElement xmlElem)
 {
     base.Load(xmlElem);
     this.timeLineKey = new TimeLineKey();
     this.timeLineKey.Load(xmlElem);
 }
Exemplo n.º 3
0
 public PriceShapeContainer_TimeLine(TimeLineKey timeLineKey)
 {
     this.timeLineKey = timeLineKey;
 }