all groups > visual studio .net ide > april 2004 >
You're in the

visual studio .net ide

group:

Iterating projects with Enterprise Templates



Iterating projects with Enterprise Templates Daniel Cazzulino [MVP XML]
4/29/2004 6:19:38 PM
visual studio .net ide: Hi there,
I'm trying to iterate and retrieve all C# and VB projects in a solution. The
solution has enterprise template projects, so I need to know the constant to
use to compare with teh Project.Kind property, or something like that.
Any help is much appretiated, thanks!

--
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.665 / Virus Database: 428 - Release Date: 24/04/2004

Re: Iterating projects with Enterprise Templates Daniel Cazzulino [MVP XML]
4/29/2004 7:29:09 PM
Working:

DTE vs = (DTE) context.GetService( typeof(DTE) );
if ( vs == null ) throw new InvalidOperationException(
SR.Gral_ServiceUnavailable( typeof(DTE) ) );

ArrayList list = new ArrayList();
Projects ps = (Projects) vs.GetObject("CSharpProjects");
if ( ps != null )
{
foreach ( Project p in ps )
{
list.Add( p.Name );
}
}
ps = (Projects) vs.GetObject("VBProjects");
if ( ps != null )
{
foreach ( Project p in ps )
{
list.Add( p.Name );
}
}

:D

--
Daniel Cazzulino [MVP XML]
Clarius Consulting SA
http://weblogs.asp.net/cazzu
http://aspnet2.com
[quoted text, click to view]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.665 / Virus Database: 428 - Release Date: 24/04/2004

AddThis Social Bookmark Button