473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Reflection of Member Interaction

Hi,

I'm exploring the reflection capabilities; I'd like to be able to find
which methods read and write to which fields and properties, and which
methods call which other methods. The idea would be to be able to make
recommendations about extracting classes - if some subset of fields is
referenced only by some subset of methods, maybe it's a new, smaller
class waiting to be born.

But all I see in the docs is PropertyInfo.GetAccessors. That's fine as
far as it goes (although I'd really like to know specifics of read- and
write- access), but I don't see a counterpart for FieldInfo or
MethodInfo. Am I missing something, or is this capability simply not
offered by the reflection classes?

Thanks,
--Carl

Nov 16 '05 #1
4 1143
I'm exploring the reflection capabilities; I'd like to be able to find
which methods read and write to which fields and properties, and which
methods call which other methods.
That would require parsing the IL code. Reflection currently doesn't
support that, but there are other libraries that do.

But all I see in the docs is PropertyInfo.GetAccessors.


That doesn't return information about code that access the property,
it returns MethodInfo objects representing the property get and/or set
methods.


Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #2
Hi, Mattias,
I'm exploring the reflection capabilities; I'd like to be able to findwhich methods read and write to which fields and properties, and whichmethods call which other methods.


That would require parsing the IL code. Reflection currently doesn't
support that, but there are other libraries that do.


Thanks for the info. Can you tell me more about where to find the
IL-parsing libraries?

Peace,
--Carl

Nov 16 '05 #3
Thanks for the info. Can you tell me more about where to find the
IL-parsing libraries?


http://www.aisto.com/roeder/dotnet/
http://research.microsoft.com/projects/ilx/absil.aspx
http://www.gotdotnet.com/Community/U...c-b5f8dfa29dd3
http://dotnet.di.unipi.it/MultipleCo....aspx?code=103

Plus Microsoft includes an unmanaged COM API in the .NET framework
SDK.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #4
Thanks, Mattias!

I've got a lot of reading to do...

Peace,
--Carl

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason Coyne Gaijin42 | last post by:
I have seen several people looking for a way to access the Columns collection when using the AutoGenerate = true option. Some people have gotten so far as to find the private autoGenColumnsArray...
0
by: Cat | last post by:
I have class Base, and class Derived. I am serializing Derived objects from XML, and these Derived objects are allowed to 'inherit' the values from other named Base objects already defined in...
3
by: Brett Kelly | last post by:
Hello all, I'm in a situation where I need to retrieve a member from the System.Data.SqlDbType enumeration knowing only the type name. At this point, I'm just trying to get reflection to...
5
by: rettigcd | last post by:
I have several classes that all have the same static member: class A{ public static string Table = "TableA"; } class B{ public static string Table = "TableB"; }
1
by: Tony Johansson | last post by:
Hello! This is a question about Reflection. I have a small program below where the class are called Mymemberinfo. This class Mymemberinfo is used in GetMembers to get all the member for this...
5
by: heddy | last post by:
I understand that reflection allows me to discover the metadata of a class at runtime (properties, methods etc). What I don't understand is where this is useful. For example: If I am the sole...
9
by: Bill Grigg | last post by:
All, Can anyone supply an example or reference to an example of using reflection to determine the data types and array lengths contained in a nested stucture in C#? Actually, it is a structure...
4
by: =?Utf-8?B?QWJoaQ==?= | last post by:
I am using Reflection to invoke methods dynamically. I have got a special requirement where I need to pass a value to method by setting the custom method attribute. As I cannot change the...
8
by: =?Utf-8?B?U2hhd24=?= | last post by:
Hi; i just started research reflection and i'm wondering if i have an empty class file can i use reflection to add member variables and attributes dynamically and then instantiate the class? What...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.