Esempio n. 1
0
        public override bool Equals(object obj)
        {
            if (!(obj is PriceRectangle))
            {
                return(false);
            }
            PriceRectangle rect = (PriceRectangle)obj;

            return(this.priceLeft == rect.priceLeft && this.priceRight == rect.priceRight &&
                   this.priceTop == rect.priceTop && this.priceBottom == rect.priceBottom);
        }
Esempio n. 2
0
        private PriceRectangle GetPriceRectangle()
        {
            if (priceRectangle == null)
            {
                priceRectangle = GetPriceRectangleInternal();
                return(priceRectangle);
            }

            IKLineData klineData = DataProvider.GetKLineData();

            if (priceRectangle.StartIndex == GetStartIndex() && priceRectangle.EndIndex == DataProvider.EndIndex)
            {
                return(priceRectangle);
            }
            priceRectangle = GetPriceRectangleInternal();
            return(priceRectangle);
        }
Esempio n. 3
0
        public void SetRect(Rectangle drawRect, PriceRectangle priceRect)
        {
            bool isDrawRectChange = this.drawRect != drawRect;

            if (isDrawRectChange)
            {
                this.drawRect = drawRect;
            }
            bool isPriceRectChange = this.priceRect != priceRect;

            if (isPriceRectChange)
            {
                this.priceRect = priceRect;
            }

            if (isDrawRectChange || isPriceRectChange)
            {
                RecalcScale();
            }
        }
Esempio n. 4
0
 public PriceGraphicMapping(Rectangle drawRect, PriceRectangle priceRect)
 {
     SetRect(drawRect, priceRect);
 }