I am trying to get a list of projects and folders under it. I am able to get the projects and project-items using:
DTE2 dte2;
dte2=(DTE2)System.Runtime.InteropServices.Marshal.
GetActiveObject("VisualStudio.DTE.10.0");
Projects projects = dte2.Solution.Projects;
Then, I am iterating through the project items and getting the "kind" of item. But it is showing only GUID. I need to know whether the item is a Folder. How do I do that?
Ref:
var item = projects.GetEnumerator();
while (item.MoveNext())
{
var project = item.Current as Project;
for(i=1;i<project.ProjectItems.Count;i++)
{
string itemType = project.ProjectItems.Item(i).Kind;
}
}
EDIT :
Currently, I am using a workaround:
string location = project.ProjectItems.Item(i).get_FileNames(1);
if (location.EndsWith(@"\"))
{
// It is a folder E.g C:\\Abc\\Xyz\\
}