How can I access the DTE (solution components) at design time?

I think this will be a very complicated question, and I hope with a very simple answer :)

I am designing couple of controls, these controls are using (Designers) and property (Converters) that works at design time in Visual Studio.NET

Today I was trying to access the solution files in Visual Studio.NET from a property converter, the converter itself is working fine with the demo data, but I need the converter to get a list of all files that are stored in the active solution.

It seams a simple task if I was writing an Add-in, but it looks complicated when trying to do the same from the control it self.

I can simplify the question as the following:

- Is there is a way to access the development environment DTE at design time?, and how can I make a link to the DEVENV.
- Do you know any other way that I can use to get a list of the files in the opened solution?

Thank you very much

[904 byte] By [codefund.com] at [2007-12-16]
# 1
You can get to it via GetService...

using EnvDTE;

within a designer:

_DTE dte = (_DTE)GetService(typeof(_DTE));

from a TypeConverter

if (context != null) {
_DTE dte = (_DTE)GetService(typeof(_DTE));
}

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 2
It works !!!!!!!!!!!!!!!!!!!!!!
:) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)

Thank you very much, I though that this will be impossible, I was even planning to change my software design.

Once I have my (themed control library) ready I will post a link to it on the message boards.

Thanks.

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 3
Excellent, glad to hear that you're moving again!
codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...
# 4
A small correction :-), I discovered that the second part of the code, about the type converter must be like that:

if (context != null)
{
_DTE dte = (_DTE)context.GetService(typeof(_DTE));
}

codefund.com at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Designer...