private void BindCurrencies() { BrokerInstrumentMapping instrumentMapping = new BrokerInstrumentMapping(); var result = instrumentMapping.SearchMapping(); foreach (var item in result) { if (item.BrokerCode.ToLower() == "bitfinex") { ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem(); toolStripMenuItem.Text = item.BrokerInstrumentCode; toolStripMenuItem.Name = item.BrokerCode + "." + item.BrokerInstrumentCode; toolStripMenuItem.Click += ToolStripMenuItem_Click; BitFinexToolStripMenuItem.DropDownItems.Add(toolStripMenuItem); } else if (item.BrokerCode.ToLower() == "mt") { ToolStripMenuItem toolStripMenuItem = new ToolStripMenuItem(); toolStripMenuItem.Text = item.BrokerInstrumentCode; toolStripMenuItem.Name = item.BrokerCode + "." + item.BrokerInstrumentCode; toolStripMenuItem.Click += ToolStripMenuItem_Click; MetaTraderToolStripMenuItem.DropDownItems.Add(toolStripMenuItem); } } }
public void AutoCompletetxtAddRow() { AutoCompleteStringCollection SymbolCollection = new AutoCompleteStringCollection(); var result = instrumentMapping.SearchMapping(); foreach (var item in result) { SymbolCollection.Add(item.BrokerCode + "." + item.BrokerInstrumentCode); } txtAddRow.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtAddRow.AutoCompleteSource = AutoCompleteSource.CustomSource; txtAddRow.AutoCompleteCustomSource = SymbolCollection; }