Exemplo n.º 1
0
        internal int IncludeFolderItem(ItemNode node)
        {
            var files = new List <string>();

            foreach (var child in node)
            {
                switch (child.Type)
                {
                case Constants.ItemNodeType.ExcludedFile:
                    files.Add(child.Path);
                    break;

                case Constants.ItemNodeType.ExcludedFolder:
                    IncludeFolderItem(child);
                    break;

                default:
                    break;
                }
            }
            node.Delete();
            uint parent = project.AddFolderItem(node.Path);

            foreach (var file in files)
            {
                ErrorHandler.ThrowOnFailure(project.AddFileItem(parent, file));
            }
            project.RefreshSolutionExplorer(new ItemNode[] { node });
            return(VSConstants.S_OK);
        }