private void btnInstruments_Select_Click(object sender, EventArgs e) { InstrumentSelectorDialog instrumentSelectorDialog = new InstrumentSelectorDialog(); instrumentSelectorDialog.Instruments = InstrumentManager.Instruments; instrumentSelectorDialog.SelectedInstruments = this.Instruments; if (instrumentSelectorDialog.ShowDialog((IWin32Window)this) == DialogResult.OK) { this.Instruments = instrumentSelectorDialog.SelectedInstruments; } instrumentSelectorDialog.Dispose(); }
private void btnSelect_Click(object sender, EventArgs e) { InstrumentSelectorDialog instrumentSelectorDialog = new InstrumentSelectorDialog(); List <Instrument> list1 = new List <Instrument>(); foreach (string str in this.symbols) { list1.Add(InstrumentManager.Instruments[str]); } instrumentSelectorDialog.Instruments = InstrumentManager.Instruments; instrumentSelectorDialog.SelectedInstruments = list1.ToArray(); if (instrumentSelectorDialog.ShowDialog((IWin32Window)this) == DialogResult.OK) { List <string> list2 = new List <string>(); foreach (Instrument instrument in instrumentSelectorDialog.SelectedInstruments) { list2.Add(((FIXInstrument)instrument).Symbol); } this.symbols = list2.ToArray(); } instrumentSelectorDialog.Dispose(); this.btnSelect.Text = string.Format("{0} symbol(s) selected...", (object)this.symbols.Length); }
private void AddRemoveInstruments() { List <Instrument> list = new List <Instrument>(); foreach (DownloadViewItem downloadViewItem in this.ltvDownload.Items) { list.Add(downloadViewItem.Instrument); } InstrumentSelectorDialog instrumentSelectorDialog = new InstrumentSelectorDialog(); instrumentSelectorDialog.Instruments = InstrumentManager.Instruments; instrumentSelectorDialog.SelectedInstruments = list.ToArray(); if (instrumentSelectorDialog.ShowDialog((IWin32Window)this) == DialogResult.OK) { this.ltvDownload.BeginUpdate(); this.ltvDownload.Items.Clear(); foreach (Instrument instrument in instrumentSelectorDialog.SelectedInstruments) { this.ltvDownload.Items.Add((ListViewItem) new DownloadViewItem(instrument)); } this.ltvDownload.EndUpdate(); } instrumentSelectorDialog.Dispose(); }