예제 #1
0
		private void instrumentListSource_SeriesRenamed(object sender, BarSeriesEventArgs args)
		{
			if (this.instrumentListSource == null || !this.instrumentListSource.ShowSeries)
				return;
			MethodInvoker methodInvoker = (MethodInvoker)(() =>
			{
				if (this.cbxSeries.SelectedItem == null || (this.cbxSeries.SelectedItem as BarSeriesItem).Series != args.BarSeries)
					return;
				BarSeriesItem local_0 = this.cbxSeries.SelectedItem as BarSeriesItem;
				this.cbxSeries.Items.Remove((object)local_0);
				local_0.RefreshName();
				this.cbxSeries.Items.Add((object)local_0);
				this.cbxSeries.SelectedIndex = 0;
			});
			if (!this.InvokeRequired)
				return;
			this.Invoke((Delegate)methodInvoker);
		}
예제 #2
0
		private void instrumentListSource_SeriesAdded(object sender, BarSeriesEventArgs args)
		{
			if (this.instrumentListSource == null || !this.instrumentListSource.ShowSeries || args.Instrument != this.instrumentListSource.SelectedInstrument)
				return;
			this.Invoke((Action)(() =>
			{
				this.cbxSeries.Items.Add((object)new BarSeriesItem(args.BarSeries, args.Instrument));
				if (this.cbxSeries.Items.Count != 1)
					return;
				this.cbxSeries.SelectedIndex = 0;
			}));
		}