日期:2014-05-17 浏览次数:20880 次
private void simpleButton1_Click(object sender, EventArgs e) { List<SempleList> AddLyr = new List<SempleList>(); AddLyr.Add(new SempleList(0)); AddLyr.Add(new SempleList(1,false)); } public class SempleList { int ID; bool SameName; public SempleList(int ID) { this.ID = ID; } public SempleList(int ID, bool SameName) : this(ID) { this.SameName = SameName; } }
private void simpleButton1_Click(object sender, EventArgs e) { List<SempleListBase> AddLyr = new List<SempleList>(); AddLyr.Add(new SempleList1(0)); AddLyr.Add(new SempleList2(1,false)); } public class SempleList1 :SempleListBase { int ID; ... } public class SempleList2 :SempleListBase { int ID; bool SameName; }