C# SDK

Which is sdk to navigate through the c# code to find all references?

Page 1 of 1

2 Replies - 1626 Views - Last Post: 11 December 2008 - 09:34 AM Rate Topic: -----

#1 ephraimvarghese  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-December 08

C# SDK

Posted 10 December 2008 - 01:38 PM

Dear Friend,

Could you help me to find an api which help me to navigate through C# code to find all references?

Our project has reference to a file from some of the methods from other classes. I want to list all references to the specified files from all other methods, including the method name and the referenced object name, in an excel sheet.

Example:
Class files: one.cs, two.cs,three.cs,four.cs
The methods from one.cs,two.cs,three.cs are referenced to a few objects(few variables) in four.cs.

I want to write all methods which are referenced to class four.cs and which objects referenced by them , into an excel sheet after navigation through the code.

Could you please give me suggestion on this? Which Visual Studio2008 api can be used?


Thanks in advance,

Binu

This post has been edited by ephraimvarghese: 10 December 2008 - 01:56 PM


Is This A Good Question/Topic? 0
  • +

Replies To: C# SDK

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 5076
  • View blog
  • Posts: 13,704
  • Joined: 18-April 07

Re: C# SDK

Posted 10 December 2008 - 11:47 PM

I believe most of this can be accomplished through C#'s feature called "Reflection". Reflection is where C# code you write can collect information on itself. The same way you would look back on who you are and reflect on your past or what defines you as a person.

You can have C# query the code you are writing itself and collect things like the objects used, their method names, what assemblies they are in, what is seen etc.

There is quite a bit to it and has several features. Too many to go into detail here. Try looking up C# reflection on the net or in a C# book and then perhaps you will get the flash of genius on how this will work for your project.

:)
Was This Post Helpful? 0
  • +
  • -

#3 ephraimvarghese  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-December 08

Re: C# SDK

Posted 11 December 2008 - 09:34 AM

Thanks for immediate reply! But reflection is not iterating through the methods and finding the local references or variables. If it is finding local references , then only my design will work.
I am searching for any api's which search through the programs and finding the references between them.

I found that code sweep is an api in Visual studio 2005 SDK version 4. Could any body help me in using that API ?

Binu

View PostMartyr2, on 10 Dec, 2008 - 10:47 PM, said:

I believe most of this can be accomplished through C#'s feature called "Reflection". Reflection is where C# code you write can collect information on itself. The same way you would look back on who you are and reflect on your past or what defines you as a person.

You can have C# query the code you are writing itself and collect things like the objects used, their method names, what assemblies they are in, what is seen etc.

There is quite a bit to it and has several features. Too many to go into detail here. Try looking up C# reflection on the net or in a C# book and then perhaps you will get the flash of genius on how this will work for your project.

:)

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1