private static void BindConnectionEvent() { if (conn != null) { conn.CallbackException += (sender, e) => { if (connStatus != null) { //connStatus.OnError(); } }; conn.ConnectionBlocked += (sender, e) => { if (connStatus != null) { //connStatus.OnDisconnected(); } }; conn.ConnectionRecoveryError += (sender, e) => { if (connStatus != null) { connStatus.OnError((AutorecoveringConnection)sender, e.Exception); } }; conn.ConnectionShutdown += (sender, e) => { if (connStatus != null) { connStatus.OnClosed((Connection)sender, e.ReplyCode, e.ReplyText); } }; conn.RecoverySucceeded += (sender, e) => { if (connStatus != null) { connStatus.OnReconnected((AutorecoveringConnection)sender); } }; conn.ConnectionUnblocked += (sender, e) => { if (connStatus != null) { //connStatus.OnSuccess(); } }; } }