public override void RemoveElement(FileSystemElement fileSystemElement) { if (fileSystemElement != null && Childrens.Contains(fileSystemElement)) { Childrens.Remove(fileSystemElement); } }
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; }