Exemple #1
0
        protected override void OnInit()
        {
            this.instrument = this.Key as Instrument;
            DataSeriesList dataSeries = this.instrument.GetDataSeries();

            this.template = Global.ChartManager.Templates["Default Template"];
            this.Text     = "Chart [" + ((FIXInstrument)this.instrument).Symbol + "]";
            this.instrumentListSource.AddInstrument(this.instrument);
            this.instrumentListSource.SelectedInstrument = this.instrument;
            IEnumerator enumerator = dataSeries.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    IDataSeries idataSeries = (IDataSeries)enumerator.Current;
                    string      key         = DataSeriesHelper.SeriesNameToString(idataSeries.Name);
                    if (key.StartsWith("Bar") || key == "Daily")
                    {
                        this.seriesNames.Add(key, idataSeries.Name);
                        this.instrumentListSource.AddSeries(this.instrument, new BarSeries(key));
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            this.instrumentListSource.Refresh();
        }
        private void InitDataSeriesList()
        {
            DataSeriesList dataSeries = this.instrument.GetDataSeries();

            this.ltvDataSeries.BeginUpdate();
            this.ltvDataSeries.Items.Clear();
            IEnumerator enumerator = dataSeries.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    this.ltvDataSeries.Items.Add((ListViewItem) new DataSeriesViewItem((IDataSeries)enumerator.Current));
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            this.ltvDataSeries.EndUpdate();
        }