private void GetComboListData() { InstrumentClient allInstrument = new InstrumentClient(); allInstrument.Code = "All"; foreach (string exchangeCode in this._App.ExchangeDataManager.ExchangeCodes) { ExchangeSettingManager settingManager = this._App.ExchangeDataManager.GetExchangeSetting(exchangeCode); foreach (InstrumentClient instrument in settingManager.Instruments.Values) { this._InstrumentList.Add(instrument); } } this._InstrumentList.Insert(0, allInstrument); this._InstrumentCombo.ItemsSource = this._InstrumentList; this._InstrumentCombo.DisplayMemberPath = "Code"; this._InstrumentCombo.SelectedIndex = 0; this._InstrumentCombo.SelectedValuePath = "Id"; this._InstrumentCombo.SelectedItem = allInstrument; AccountGroup allGroup = new AccountGroup(); allGroup.Code = "All"; foreach (string exchangeCode in this._App.ExchangeDataManager.ExchangeCodes) { ExchangeSettingManager settingManager = this._App.ExchangeDataManager.GetExchangeSetting(exchangeCode); foreach (AccountGroup group in settingManager.GetAccountGroups()) { this._AccountGroups.Add(group); } } this._AccountGroups.Insert(0, allGroup); this._AccountGroupCombo.ItemsSource = this._AccountGroups; this._AccountGroupCombo.DisplayMemberPath = "Code"; this._AccountGroupCombo.SelectedIndex = 0; this._AccountGroupCombo.SelectedValuePath = "Id"; this._AccountGroupCombo.SelectedItem = allGroup; this.ExchangeComboBox.ItemsSource = this._App.ExchangeDataManager.ExchangeCodes; this.ExchangeComboBox.SelectedItem = this._App.ExchangeDataManager.ExchangeCodes[0]; }
private void GetComboListData() { AccountGroup allGroup = new AccountGroup(); allGroup.Code = "All"; foreach (string exchangeCode in this._App.ExchangeDataManager.ExchangeCodes) { ExchangeSettingManager settingManager = this._App.ExchangeDataManager.GetExchangeSetting(exchangeCode); foreach (AccountGroup group in settingManager.GetAccountGroups()) { this._AccountGroups.Add(group); } } this._AccountGroups.Insert(0, allGroup); this._AccountGroupCombo.ItemsSource = this._AccountGroups; this._AccountGroupCombo.DisplayMemberPath = "Code"; this._AccountGroupCombo.SelectedIndex = 0; this._AccountGroupCombo.SelectedValuePath = "Id"; this._AccountGroupCombo.SelectedItem = allGroup; }
private void LoadComboListData(string exchangeCode) { this._InstrumentList.Clear(); this._AccountGroups.Clear(); ExchangeSettingManager settingManager = this._App.ExchangeDataManager.GetExchangeSetting(exchangeCode); foreach (InstrumentClient instrument in settingManager.GetInstruments()) { this._InstrumentList.Add(instrument); } foreach (AccountGroup group in settingManager.GetAccountGroups()) { this._AccountGroups.Add(group); } InstrumentClient allInstrument = new InstrumentClient() { Code = "All" }; AccountGroup allAccountGroup = new AccountGroup(){Code = "All"}; this._InstrumentList.Insert(0, allInstrument); this._AccountGroups.Insert(0, allAccountGroup); this._InstrumentCombo.ItemsSource = this._InstrumentList; this._InstrumentCombo.DisplayMemberPath = "Code"; this._InstrumentCombo.SelectedValuePath = "Id"; this._InstrumentCombo.SelectedItem = allInstrument; this._AccountGroupCombo.ItemsSource = this._AccountGroups; this._AccountGroupCombo.DisplayMemberPath = "Code"; this._AccountGroupCombo.SelectedValuePath = "Id"; this._AccountGroupCombo.SelectedItem = allAccountGroup; }