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

visual studio .net ide

group:

Retrieve List of Components (e.g., DataSets)


Retrieve List of Components (e.g., DataSets) Mark Olbert
3/25/2004 6:40:25 AM
visual studio .net ide:
(this didn't seem to post, so I'm trying again)

How do the various IDE actions which retrieve lists of DataSets, and referenced DataSets, from
within the IDE work? I want to be able to "borrow" the methodology so I can "scan" the active
project for components of an arbitrary defined type (e.g., MyComponent).

I've looked through (some) of the IDE macro examples, and can see how to retrieve the various source
code files. However, I don't think that would meet my needs, as the source code files don't "know"
what type of object they are.

One way that could work, I think, is to find the assembly for the current active project, load it,
and then look through all its types looking for objects of type, e.g., MyComponent. However, I
haven't been able to see how, using the VSNET "library" (i.e., EnvDTE), to find that assembly. I
guess I could always just assume it's in the subdirectory bin/Debug or bin/Release (I'm only
concerned about Windows.Forms applications here) of the project directory, with the same name as the
project, but that sounds a little kludgy.

Is there a way to identify the active project assembly from using EnvDTE?

RE: Retrieve List of Components (e.g., DataSets) v-garych NO[at]SPAM online.microsoft.com
3/26/2004 10:29:48 AM
Hi Mark,

[quoted text, click to view]

Are the DTE.ActiveSolutionProjects, DTE.Solution.Projects or the
DTE.Solution.Projects.ProjectItems you mentioned?

However, it appears no such method to identify the active project assembly
within these objects.


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
RE: Retrieve List of Components (e.g., DataSets) v-garych NO[at]SPAM online.microsoft.com
3/26/2004 10:47:38 AM
Hi Mark,

[quoted text, click to view]

I suggest you can have a try of the
EnvDTE.DTE.ActiveSolutionProjects(.Project).CodeModel.CodeElements .

The following are some reference and example of it:
http://www.knowdotnet.com/articles/copycontrolsandcode.html
http://www.knowdotnet.com/articles/getwholeprocedure.html
http://www.codeproject.com/macro/classdep.asp


Wish it helps!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
RE: Retrieve List of Components (e.g., DataSets) v-garych NO[at]SPAM online.microsoft.com
3/30/2004 1:14:07 AM
Hi Mark,

Is the CodeModel.CodeElements you are looking for?


Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
AddThis Social Bookmark Button