Example #1
0
        // <remarks>
        //   Equals: two multicast delegates are equal if their base is equal
        //   and their invocations list is equal.
        // </remarks>
        public sealed override bool Equals(object obj)
        {
            if (!base.Equals(obj))
            {
                return(false);
            }

            MulticastDelegate d = obj as MulticastDelegate;

            if (d == null)
            {
                return(false);
            }

            MulticastDelegate this_prev = this.prev;
            MulticastDelegate obj_prev  = d.prev;

            do
            {
                if (this_prev == null)
                {
                    return(obj_prev == null);
                }

                if (!this_prev.Compare(obj_prev))
                {
                    return(false);
                }

                this_prev = this_prev.prev;
                obj_prev  = obj_prev.prev;
            } while (true);
        }