//读取数据表 public void InitSkillInfo() { _UsuallyInfo = new List <string>(); List <string[]> usualDataList = CfgReader.ReadCfg("UsualInfo"); foreach (string[] dataStr in usualDataList) { string dataInfo = dataStr[2]; _UsuallyInfo.Add(dataInfo); } }
private void ComboBoxPopulate() { try { var items = CfgReader.ReadCfg(@"Profiles.ini").OrderBy(x => x.Title).ToList(); ComboBoxProfile.ItemsSource = items; ComboBoxProfile.DisplayMemberPath = "Title"; ComboBoxProfile.SelectedValuePath = "Data"; ComboBoxProfile.Text = "Select profile..."; } catch (Exception e) { Console.WriteLine("An error occured: " + e); ComboBoxProfile.IsEnabled = false; } }