Пример #1
0
        unsafe StackObject *ILInvokeSub(ILIntepreter intp, StackObject *esp, IList <object> mStack)
        {
            var  ebp = esp;
            bool unhandled;

            if (method.HasThis)
            {
                esp = ILIntepreter.PushObject(esp, mStack, instance);
            }
            int paramCnt = method.ParameterCount;

            for (int i = paramCnt; i > 0; i--)
            {
                intp.CopyToStack(esp, Minus(ebp, i), mStack);
                esp++;
            }
            var ret = intp.Execute(method, esp, out unhandled);

            if (next != null)
            {
                if (method.ReturnType != appdomain.VoidType)
                {
                    intp.Free(ret - 1);//Return value for multicast delegate doesn't make sense, only return the last one's value
                }
                DelegateAdapter n = (DelegateAdapter)next;
                ret = n.ILInvokeSub(intp, ebp, mStack);
            }
            return(ret);
        }
Пример #2
0
 public override bool Equals(object obj)
 {
     if (obj is DelegateAdapter)
     {
         DelegateAdapter b = (DelegateAdapter)obj;
         return(instance == b.instance && method == b.method);
     }
     return(false);
 }
Пример #3
0
 public virtual bool Equals(IDelegateAdapter adapter)
 {
     if (adapter is DelegateAdapter)
     {
         DelegateAdapter b = (DelegateAdapter)adapter;
         return(instance == b.instance && method == b.method);
     }
     else
     {
         return(false);
     }
 }