阅读背景:

根据属性的类型使用文本框或复选框

来源:互联网 

If I have this structure:

如果我有这个结构:

public class Parent
{
  public string Name{get; set;}
  public List<Child> Childs {get; set;}
}

public class Child
{
  public string Name{get; set;}
  public int Age {get; set;}
  public bool Married {get; set;}
}

public class ParentFactory
{
   public List<Parent> Parents {get; set;}

   public ParentFactory()
   {
      Child child1 = new Child() {Name="Peter", Age=10, Married=true};
      Child child2 = new Child() {Name="Mary", Age=9, Married=false};
      Child child3 = new Child() {Name="Becky", Age=12, Married=true};

      Parent parent1 = new Parent(){Name="Adam", Childs = new List<Child>(){child1, child2}};
      Parent parent2 = new Parent(){Name="Kevin", Childs = new List<Child>(){child3}};

      Parents = new List<Parent>(){parent1, parent2};
   }
}
public 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: