예제 #1
0
        protected override __Delegate RemoveImpl(__Delegate d)
        {
            var j = -1;
            var a = ((__Delegate[])(object)list);


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

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

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

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

            return(a.CombineImpl(b));
        }
예제 #4
0
 protected virtual __Delegate CombineImpl(__Delegate d)
 {
     return(null);
     //throw new global::System.Exception("use MulticastDelegate instead");
 }
예제 #5
0
        protected override __Delegate CombineImpl(__Delegate d)
        {
            list.push(d);

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