Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProjectItem folder =
- item.ProjectItem.Collection.AddFolder(newDirectoryName, string.Empty);
- DirectoryInfo dirInfo = new DirectoryInfo(newDirectoryParent +
- newDirectoryName);
- if (dirInfo.Exists)
- {
- dirInfo.Delete(true);
- }
- ProjectItem folder =
- item.ProjectItem.Collection.AddFolder(newDirectoryName, string.Empty);
- DirectoryInfo dirInfo = new DirectoryInfo(newDirectoryParent + newDirectoryName);
- if (dirInfo.Exists)
- {
- dirInfo.Delete(true);
- item.DTE.ExecuteCommand("View.Refresh", string.Empty);
- }
- ProjectItem folder = item.ProjectItem.Collection.AddFolder(newDirectoryName, string.Empty);
- ProjectItem pi = null;
- var dir = Path.Combine(
- project.Properties.Item("LocalPath").Value.ToString(), SubdirectoryName);
- if (Directory.Exists(dir))
- pi = target.ProjectItems.AddFromDirectory(dir);
- else
- pi = target.ProjectItems.AddFolder(dir);
- <ItemGroup>
- <compile include="pathrootFolderToInclude***.cs" />
- </ItemGroup>
- //Getting the current project
- private DTE2 _applicationObject;
- System.Array projs = (System.Array)_applicationObject.ActiveSolutionProjects;
- Project proy=(Project)projs.GetValue(0);
- //Getting the path
- string path=proy.FullName.Substring(0,proy.FullName.LastIndexOf('\'));
- //Valitating if the path exists
- bool existsDirectory= Directory.Exists(path + "\Directory");
- //Deleting and creating the Directory
- if (existeClasses)
- Directory.Delete(path + "\Directory", true);
- Directory.CreateDirectory(path + "\Directory");
- //Including in the project
- proy.ProjectItems.AddFromDirectory(path + "\Directory");
Add Comment
Please, Sign In to add comment