Example #1
0
        public void Load(XmlElement xmlElem)
        {
            string type = xmlElem.GetAttribute("datatype");

            if ("kline".Equals(type))
            {
                dataKey = new KLineKey();
                ((KLineKey)dataKey).Load(xmlElem);
            }
            else if ("timeline".Equals(type))
            {
                dataKey = new TimeLineKey();
                ((TimeLineKey)dataKey).Load(xmlElem);
            }

            XmlNode node = xmlElem.ChildNodes[0];

            if (node is XmlElement)
            {
                XmlElement elem = (XmlElement)node;
                this.title = new StrategyGraphicTitle();
                this.title.Load(elem);
            }
            this.priceShapes = new PriceShapeContainer();
            this.priceShapes.Load(xmlElem);
        }
Example #2
0
        public void RemoveContainer(IPriceShapeContainer priceShapeContainer)
        {
            this.containers.Remove(priceShapeContainer);
            IDataKey dataKey = priceShapeContainer.GraphicKey;

            if (dataKey == null)
            {
                return;
            }
            if (dataKey is KLineKey)
            {
                klineKeies.Remove((KLineKey)dataKey);
            }
            else if (dataKey is TimeLineKey)
            {
                timeLineKeies.Remove((TimeLineKey)dataKey);
            }
        }
Example #3
0
        public void AddContainer(IPriceShapeContainer priceShapeContainer)
        {
            this.containers.Add(priceShapeContainer);
            IDataKey dataKey = priceShapeContainer.GraphicKey;

            if (dataKey == null)
            {
                return;
            }
            dic_GraphicKey_Container.Add(dataKey, priceShapeContainer);
            graphicKeies.Add(dataKey);
            if (dataKey is KLineKey)
            {
                klineKeies.Add((KLineKey)dataKey);
            }
            else if (dataKey is TimeLineKey)
            {
                timeLineKeies.Add((TimeLineKey)dataKey);
            }
        }
Example #4
0
 public StrategyGraphic(IDataKey dataKey)
 {
     this.dataKey     = dataKey;
     this.title       = new StrategyGraphicTitle();
     this.priceShapes = new PriceShapeContainer();
 }