예제 #1
0
 public void AddChild(Child c)
 {
     if (DS.DataSource.Childs.Exists(ch => ch.ID == c.ID))// check if the child allready exists
     {
         throw new Exception("Child allready exists");
     }
     DS.DataSource.Childs.Add(c.ChildDeepClone());
 }
예제 #2
0
 public void AddChild(Child newchild)
 {
     if (ExistChild(newchild))
     {
         throw new Exception("ERROR Child is allready exist!! Please check child ID.");
     }
     DataSource.Childs.Add(newchild.ChildDeepClone());
 }
예제 #3
0
 public void AddChild(Child child)
 {
     if (!DS.DataSource.List_of_Children.Any(item => item.ID == child.ID))
     {
         DS.DataSource.List_of_Children.Add(child.ChildDeepClone());
     }
     else
     {
         throw new Exception("ERROR!: Child already exists\n");
     }
 }