示例#1
0
        IFileNode AddFile(string filePath)
        {
            if (Children.Any(x => SamePath(x.Path, filePath)))
            {
                return(null);
            }
            if (Children.Any(x => x.Name == System.IO.Path.GetFileName(filePath)))
            {
                return(null);
            }
            var node = _nodeFactory.CreateFileNode(filePath);

            if (node != null)
            {
                _children.Add(node);
            }
            return(node);
        }