Beispiel #1
0
 public override void RemoveElement(FileSystemElement fileSystemElement)
 {
     if (fileSystemElement != null && Childrens.Contains(fileSystemElement))
     {
         Childrens.Remove(fileSystemElement);
     }
 }
Beispiel #2
0
        public void AddChildrenComment(Comment children)
        {
            if (Childrens.Contains(children))
            {
                throw new InvalidOperationException("Duplicated comment");
            }

            if (children.Equals(this))
            {
                throw new InvalidOperationException("Looped comment");
            }

            children.Parent = this;
            var newChildrens = Childrens.ToList();

            newChildrens.Add(children);
            Childrens = newChildrens;
        }