SmartQuant.FinChart.Chart.OnItemAdded C# (CSharp) Method

OnItemAdded() public method

public OnItemAdded ( ) : void
return void
        public void OnItemAdded()
        {
            bool flag = false;
            lock (this.lockObject)
            {
                this.contentUpdated = true;
                if (this.firstIndex == -1)
                    this.firstIndex = 0;
                switch (this.updateStyle)
                {
                    case ChartUpdateStyle.WholeRange:
                            SetIndexInterval(0, MainSeries.Count - 1);
                            flag = true;
                            break;
                    case ChartUpdateStyle.Trailing:
                        if (this.lastIndex - this.firstIndex + 1 < this.minCountOfBars)
                            SetIndexInterval(this.firstIndex, this.lastIndex + 1);
                        else
                            SetIndexInterval(this.firstIndex + 1, this.lastIndex + 1);
                        flag = true;
                        break;
                }
            }
            if (flag)
                Invalidate();
            #if !GTK
            Application.DoEvents();
            #endif
        }