DTE get all using statement

  • Thread starter Thread starter SD WinGirl
  • Start date Start date
S

SD WinGirl

I am writing an automation utility with the DTE model in C#. I need
to open up a C# file and read all the "using statements" contained in
that file.
I do not see a way to be able to do this with the ProjectItem.

Have I missed something? Can someone please suggest a way to
accomplish this?
Thanks.
 
I am writing an automation utility with the DTE model in C#. I need
to open up a C# file and read all the "using statements" contained in
that file.
I do not see a way to be able to do this with the ProjectItem.

Have I missed something? Can someone please suggest a way to
accomplish this?


For what do you need all using statements?
 
I am auto-generating the C# files. In the generation I have tied the
using statement to the reference assemblies I have created.

For example:
If I parse the following line
using Utility.Logger;
I will need to add the following reference
Utility.Logger.dll

Besides opening and reading the file line-by-line to parse the using
statement lines...can someone suggest a better alternative?

Thanks,
Ha
 
I am auto-generating the C# files. In the generation I have tied the
using statement to the reference assemblies I have created.

For example:
If I parse the following line
using Utility.Logger;
I will need to add the following reference
Utility.Logger.dll

Besides opening and reading the file line-by-line to parse the using
statement lines...can someone suggest a better alternative?


I have no clue what a DTE model is, but you could explain it to me.
However why don't you just use reflection on the correcponding assemly to
get the namespaces of the classes?
 
Back
Top