<p>This is from an example accompanying the agsXMPP .Net assembly.  I've read up on delegates, but am not sure how that fits in with this line of code (which waits for the logon to occur, and then sends a message.  I guess what I'm looking for is an understanding of why <code>delegate(0)</code> accomplishes this, in the kind of simple terms I can understand.</p>

<pre><code>xmpp.OnLogin += delegate(object o) { 
    xmpp.Send(new Message(new Jid(JID_RECEIVER), 
    MessageType.chat, 
    "Hello, how are you?")); 
};
</code></pre>

That is creating an anonymous function.  This feature was introduced in C# 2.0