Exemplo n.º 1
0
        protected override __Delegate  RemoveImpl(__Delegate d)
        {
            var j = -1;

            for (int i = 0; i < list.length; i++)
            {
                if (list[i] == d)
                {
                    j = i;
                    break;
                }
            }

            if (j > -1)
            {
                list.splice(j, 1);
            }

            if (list.length == 0)
            {
                return(null);
            }

            return(this);
        }
Exemplo n.º 2
0
 public static __Delegate Remove(__Delegate source, __Delegate value)
 {
     if (source == null)
     {
         return(null);
     }
     if (value == null)
     {
         return(source);
     }
     return(source.RemoveImpl(value));
 }
Exemplo n.º 3
0
        public static __Delegate Combine(__Delegate a, __Delegate b)
        {
            if (a == null)
            {
                return(b);
            }
            if (b == null)
            {
                return(a);
            }

            return(a.CombineImpl(b));
        }
Exemplo n.º 4
0
        public static bool IsEqual(__Delegate a, __Delegate b)
        {
            if ((object)a == null)
            {
                return(false);
            }

            if ((object)b == null)
            {
                return(false);
            }

            return(a.Method == b.Method &&
                   a.Target == b.Target);
        }
Exemplo n.º 5
0
        protected override __Delegate CombineImpl(__Delegate d)
        {
            list.push(d);

            return(this);
        }
Exemplo n.º 6
0
 protected virtual __Delegate RemoveImpl(__Delegate d)
 {
     throw new global::System.Exception("use MulticastDelegate instead");
 }