Esempio n. 1
0
 //Insert the modified child in list and save
 public void SetModifiedChild(Child c, int i)
 {
     listChildren.RemoveAt(i);
     listChildren.Insert(i, c);
     list.SetList(listChildren);
     list.SaveListOfChildren();
 }
Esempio n. 2
0
        //insert new child in list and save this
        public void SetListWithNewChild(Child c, ListOfChildren list)
        {
            List <Child> children = list.GetList();

            children.Add(c);
            list.SetList(children);
            list.SaveListOfChildren();
        }
Esempio n. 3
0
        public RemoveChild(int index, ListOfChildren list)
        {
            list.listChildren.RemoveAt(index);
            List <Child> children = list.GetList();

            foreach (Child i in children)
            {
                if (i.GetCod() > index + 1)
                {
                    i.SetCod(i.GetCod() - 1);
                }
            }

            list.SaveListOfChildren();
        }