1 实时同步,您可以运用数据绑定机制,数据源变动后,控件显示的数据跟随变动。
类似于这样的代码
List<Country> countries = new List<Country> { new Country("UK"),
new Country("Australia"),
new Country("France") };
bindingSource1.DataSource = countries;
comboBox1.DataSource = bindingSource1.DataSource;
comboBox1.DisplayMember = "Name";
comboBox1.ValueMember = "Name";public class Country
{
public string Name { get; set; }
public IList<City> Cities { get; set; }
public Country(string _name)
{
Cities = new List<City>();
Name = _name;
}
}
2 遍历函数需要用语言语法翻译组件,参考下
语意级别,可以分析到标识符 https://www.filipekberg.se/2011/10/20/using-roslyn-to-parse-c-code-files/
语法级别,直接能取到类型定义,方法定义和属性 https://github.com/icsharpcode/SharpDevelop/wiki/NRefactory
https://www.codeproject.com/articles/408663/webcontrols/
Using NRefactory for analyzing C# code
专注于.NET ERP/CRM开发框架,C/S架构,SQL Server + ORM(LLBL Gen Pro) + Infragistics WinForms