On Sun, 2009-10-04 at 15:49 +0800, Wee Li Yen wrote:
> Can someone explain what are these referring to in Mono.Cecil?
> TypeReference,

A reference to a type (which may be present within another assembly).

For example, if you compile the code:

        Console.WriteLine();

the IL will be:

        call void class [mscorlib]System.Console::WriteLine()

which in Mono.Cecil will be a MethodReference to
System.Console.WriteLine(), and MethodReference.DeclaringType will be a
TypeReference to System.Console.

>  ExternType, Override,

In this class:

        class Demo {
                public override string ToString() {return "demo";}
        }

The virtual method System.Object.ToString() is overridden.  All
overridden methods are present within an Overrides table for a type.

> NestedType,

A type declared within another type, e.g.:

        class List<T> {
                public struct Enumerator {}
        }

List<T>.Enumerator is a nested type.

>  PInvokeInfo,

When you use the [DllImport] attribute on a method.

>  SecurityDeclaration

Many System.Security attributes aren't saved as normal custom attributes
in IL, but instead are stored "specially".  Thus, there is a specific
table to store these "attributes".

(i.e. they only look like custom attributes within C# source, much like
[Serializable], but they're not really custom attributes.)

> and CustomAttribute

Used to store custom attributes:

        [AttributeUsage(AttributeTargets.All)]
        class FooAttribute : Attribute {
                public FooAttribute(string foo) {}
        }

        [Foo ("this is a custom attribute!")]
        class Bar {}

> and MarshalSpec

Used for custom marshaling.  Usually used only for P/Invoke marshaling.

 - Jon




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

Reply via email to