HEY this is my first posting here,, my doubt is 2 fold :P here goes

1.OK, i know that value data types go into stack and reference data types go into heap,, this is my understanding of this,, suppose there is an integer variable x = 30, then the stack will hold the address of the variable x which is represented in hexadecimal gibberish .. and in the case of reference type, suppose object data type refers to the variable x ,, so does that mean the heap memory will contain the memory address for the object data type that contains the memory address of variable x which holds the value 30 :P

2.My second doubt is regarding a code snippet i have come across, It is an MCTS question btw ,,
ok so we have a custom control called OrderForm made in ASP.Net 3.5.

1.public delegate void CheckOrderFormEventHandler (EventArgs e);
2.private static readonly object CheckOrderFormKey = new object();

3.public event CheckOrderFormEventHandler CheckOrderForm
{
4. add { Events.AddHandler ( CheckOrderFormKey, value) ; }
5. remove { Events.RemoveHandler ( CheckOrderFormKey, value) ; }
}

So here we are trying to create an event for the custom control and for that we require a delegate which is done in line 1 and the actual event is declared in step 3, some object is declared in step 2 which is readonly, my DOUBT is this,, what happens in steps 4 and 5 what is this add/remove { } construct? and can somebody explain wht is the purpose of events.addhandler/removehandler and wht is the earlier instantiated object checkorderformkey doing in the argumentslist? wht is the second argument??

im reqd to write the eventhandler code

this is the answer
1.protected virtual void OnCheckOrderForm(EventArgs e)
{
2. CheckOrderFormEventHandler checkOrderForm= Events[CheckOrderFormKey] as CheckOrderFormEventHandler;
4if (checkOrderForm!=null)
5.checkOrderForm(e);
}

whats going on in step 2
and step4and step 5?? im totally clueless X_X