Hey,
That's very easy to do:
MethodBody body = ...;
List<MethodReference> references = new List<MethodReference> ();
foreach (Instruction instr in body.Instructions) {
if (instr.OpCode.OperandType != OperandType.InlineMethod)
continue;
references.Add ((MethodReference) instr.Operand);
}
On 9/18/07, rongchaua <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> in a method we can call many functions in another classes. I would
> like to ask if we can make a list of methodreferences of this method.
> For example:
>
> We have a method A1 of class A. This method calls B1, C1 of classes B
> and C.
> ******
> private void A.A1()
> {
> .....
> B.B1();
> ......
> C.C1();
> }
> ******
>
> Can we get a list of this references (B,C) with Cecil?
> Thank you.
> Regards.
> rca.
>
>
> >
>
--
Jb Evain <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---