I'm writing a C++ Project template in VS 2010 using the Custom Wizard technique.
In the default.js, the file which holds the behind JavaScript code, I want to take the current generated project, and locate it in an existing VS solution, in a specific "apps" subfolder.
I have a C# working code which does the above, but I have to rewrite it in JavaScript.
My C# code is:
Projects ps = solution.Projects;var item = ps.GetEnumerator();while(item.MoveNext()){var project = item.CurrentasProject;string name = project.Name;if(name =="apps"){SolutionFolder folder =(SolutionFolder)project.Object;
p = folder.AddFromFile(newProjDir +"\\"+ projName +".vcxproj");}}
In JavaScript, I wrote:
var ps =Solution.Projects;
But now I don't succeed to iterate over the projects, as I did in c#.
When I'm trying to write in the JS file:
var item = ps.GetEnumerator();
I'm getting the run time error:
Object doesn't support this property or method
Do you know about any way to iterate over the Projects collection? Is there a JS function which behaves like GetEnumerator()
?