Difference btn MethodReference and MethodDefinition?

View: New views
3 Messages — Rating Filter:   Alert me  

Difference btn MethodReference and MethodDefinition?

by yeeen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
What is the difference btn a MethodReference and MethodDefinition?
 
It seems like  methods under the same file as main or calling the constructors are MethodDefinitions, others are MethodReferences?
 
Thanks!

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: Difference btn MethodReference and MethodDefinition?

by Jonathan Pryor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Oct 5, 2009, at 8:11 AM, Wee Li Yen <weeliyen@...> wrote: 
What is the difference btn a MethodReference and MethodDefinition?

A MethodReference is a reference to a method, which may be defined in another assembly (e.g. a call to Console.WriteLine() from yor app).

A MethodDefinition is the actual method itself, thus allowing access to the method's IL, etc.

 - Jon


--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---


Re: Difference btn MethodReference and MethodDefinition?

by yeeen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for ur reply.
 
I don't quite understand "A MethodDefinition is the actual method itself, thus allowing access to the method's IL, etc.".
 
Cos I did more printings of the instructions' opcodes and operands of those method calls today and realised that MethodDefintion seems to be in the same assembly, just opp of what MethodReference is.
 
Li Yen

Sent: Monday, October 05, 2009 8:49 PM
Subject: [mono-cecil] Re: Difference btn MethodReference and MethodDefinition?

On Oct 5, 2009, at 8:11 AM, Wee Li Yen <weeliyen@...> wrote: 
What is the difference btn a MethodReference and MethodDefinition?

A MethodReference is a reference to a method, which may be defined in another assembly (e.g. a call to Console.WriteLine() from yor app).

A MethodDefinition is the actual method itself, thus allowing access to the method's IL, etc.

 - Jon

--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---