You have to set the RegisterAccount property to true before you connect. The library tries to register the new account and logs in with this account after success (if success).
OnRegistered event is raised when the account was created successful.
OnRegisterError event is called on errors.
XmppClientConnection xmpp = new XmppClientConnection();
// other code
xmpp.Username = "userName";
xmpp.Password = "secretPassword";
xmpp.RegisterAccount = true;
xmpp.OnRegisterError += xmpp_OnRegisterError;
xmpp.OnRegistered += xmpp_OnRegistered;
xmpp.Open();
void xmpp_OnRegistered(object sender)
{
//handle accordingly
}
void xmpp_OnRegisterError(object sender, agsXMPP.Xml.Dom.Element e)
{
//handle accordingly
}