.class private auto ansi beforefieldinit ListItem
extends [mscorlib]System.Object
{
.field public class ListItem Prev
.field public class ListItem Next
.method public hidebysig newslot virtual
instance void Dump() cil managed
{
.maxstack 0
IL_0000: ret
} // end of method ListItem::Dump
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
.maxstack 1
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0006: ret
} // end of method ListItem::.ctor
} // end of class ListItem
Listing 12.3 Declaration of the ListItem class.
There’s not a whole lot to the ListItemclass. It has two fields, Prevand
Next, which are both defined as ListItemreferences. This is obviously a
classic linked-list structure. Other than the two data fields, the class doesn’t
really have much code. You have the Dumpvirtual method, which contains an
empty implementation, and you have the standard constructor, .ctor, which
is automatically created by the compiler.
The LinkedList Class
We now proceed to the declaration of LinkedListin Listing 12.4, which is
apparently the root object from where the linked list is managed.
.class private auto ansi beforefieldinit LinkedList
extends [mscorlib]System.Object
{
.field private class ListItem ListHead
.method public hidebysig instance void
AddItem(class ListItem NewItem) cil managed
{
.maxstack 2
IL_0000: ldarg.1
Listing 12.4 Declaration of LinkedList object. (continued)
Reversing .NET 439