public void InvokeOnData(object sender, object dataObject) { Error error = (Error)dataObject; XmppClientConnection connection = (XmppClientConnection)sender; connection.InvokeOnError(error); }