Exemplo n.º 1
0
        public void AddSibling(Node n)
        {
            Siblings.Add(n);
            isLonely = false;
            n.Level  = this.Level;

            addOwnerTree(n);
        }
Exemplo n.º 2
0
 public void AddSibling(Cell cell)
 {
     if (cell != null)
     {
         Siblings.Add(cell);
         cell.Siblings.Add(this);
     }
 }
 public void AddSibling(Person person)
 {
     Siblings ??= new List <Person>();
     if (!Siblings.Contains(person))
     {
         Siblings.Add(person);
     }
     else
     {
         throw new Exception("Sibling already present");
     }
 }
Exemplo n.º 4
0
 private void Initialize(string path)
 {
     if (IsDir)
     {
         var files = Directory.GetFileSystemEntries(path);
         foreach (var file in files)
         {
             var newSibling = new FilesystemElement(file, _treeRoot);
             Siblings.Add(newSibling);
         }
     }
     else
     {
         VirtualPath = ToVirtualPath(path);
     }
 }
Exemplo n.º 5
0
        public void UpdatePatientSiblings()
        {
            if (Siblings == null)
            {
                Siblings = new List <Sibling>();
            }

            var SiblingsNew = new List <Sibling>();

            if (Sisters != null && Sisters.Count != 0)
            {
                SiblingsNew.AddRange(Sisters);
            }

            if (Brothers != null && Brothers.Count != 0)
            {
                SiblingsNew.AddRange(Brothers);
            }
            // Insert
            foreach (Sibling siblingNew in SiblingsNew)
            {
                if (!Siblings.Any(row => row.Id == siblingNew.Id && row.Id != 0))
                {
                    siblingNew.Patient = this;
                    Siblings.Add(siblingNew);
                }
            }

            // ToDo Delete
            //var siblingsToControl = new List<Sibling>();
            //siblingsToControl.AddRange(Siblings);

            //foreach (Sibling siblingToControl  in siblingsToControl)
            //{
            //    if (!SiblingsNew.Any(row => row.Id == siblingToControl.Id && row.Id != 0))
            //    {

            //        Siblings.RemoveAll(row => row.Id == siblingToControl.Id);
            //    }
            //}
        }
Exemplo n.º 6
0
        public void Insert(string path)
        {
            var newElement = new FilesystemElement(path, this);

            Siblings.Add(newElement);
        }
Exemplo n.º 7
0
        public void AddSibling(string txt)
        {
            Node tmp = new Node(txt);

            Siblings.Add(tmp);
        }