Beispiel #1
0
        public static bool IsEqual(__Delegate a, __Delegate b)
        {
            // X:\jsc.svn\examples\javascript\Test\TestWebSQLDatabase\TestWebSQLDatabase\Application.cs

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

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

            if (a.InternalMethod == b.InternalMethod)
            {
                if (a.InternalTarget == b.InternalTarget)
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #2
0
        protected override __Delegate RemoveImpl(__Delegate d)
        {
            // 2015, could replace this by roslyn linq?

            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);
        }
Beispiel #3
0
        public static IFunction AsFunction(__Delegate x)
        {
            if (x == null)
            {
                return(null);
            }

            return(x.InvokePointer);
        }
Beispiel #4
0
 public static __Delegate Remove(__Delegate source, __Delegate value)
 {
     if (source == null)
     {
         return(null);
     }
     if (value == null)
     {
         return(source);
     }
     return(source.RemoveImpl(value));
 }
Beispiel #5
0
        public static __Delegate Combine(__Delegate a, __Delegate b)
        {
            if ((object)a == null)
            {
                return(b);
            }
            if ((object)b == null)
            {
                return(a);
            }

            return(a.CombineImpl(b));
        }
Beispiel #6
0
 protected virtual __Delegate RemoveImpl(__Delegate d)
 {
     throw new global::System.Exception("use MulticastDelegate instead");
 }
Beispiel #7
0
        protected override __Delegate CombineImpl(__Delegate d)
        {
            list.push(d);

            return(this);
        }