void InternalAddVirtualFolder(string path, bool addToDoc) { _io.AddVirtualFolder(path); var vnode = _nodeFactory.CreateFolderNode(System.IO.Path.GetFileName(path)); Children.Insert(0, vnode); if (addToDoc) { _doc.Root.Add(new XElement("Virtual-Folder", path)); Save(); } }
IFolderNode AddDirectory(string directory) { if (Children.Any(x => SamePath(x.Path, directory))) { return(null); } if (Children.Any(x => x.Name == System.IO.Path.GetFileName(directory))) { return(null); } var node = _nodeFactory.CreateFolderNode(directory); _children.Add(node); return(node); }