/// <summary>
 /// Determines whether this callback listener
 /// is equal to another <see cref="T:CallbackMessageListener&lt;T&gt;"/> object.
 /// </summary>
 public bool Equals(CallbackMessageListener <T> other)
 {
     // TODO: Object.ReferenceEquals()
     return(other != null && _callback.Equals(other._callback) &&
            ((_stateObject == null && other._stateObject == null) ||
             (_stateObject != null && other._stateObject != null && _stateObject.Equals(other._stateObject))));
 }
        /// <summary>
        /// Determines whether this callback listener
        /// and the specified <see cref="Object"/> are equal.
        /// </summary>
        public override bool Equals(object obj)
        {
            CallbackMessageListener <T> other = obj as CallbackMessageListener <T>;

            if (other != null)
            {
                return(this.Equals(other));
            }

            return(base.Equals(obj));
        }