CallProlog() public static method

public static CallProlog ( object target, string module, string name, int arity, object origin, object paramz, System.Type.Type returnType, bool discard ) : object
target object
module string
name string
arity int
origin object
paramz object
returnType System.Type.Type
discard bool
return object
Ejemplo n.º 1
0
        //#pragma unsafe
        public override object CallPrologFast(object[] paramz)
        {
            //lock (oneEvtHandlerAtATime)
            {
                try
                {
                    string module = Key.Module ?? "user";
                    PrologEvents++;
                    if (!knownDefined && !PrologCLR.IsDefined(module, Key.Name, PrologArity))
                    {
                        //PrologCLR.Warn("Undefined Event Handler {0}:{1}/{2}", module, Key.Name, PrologArity);
                        return(null);
                    }
                    knownDefined = true;
                    return(PrologCLR.CallProlog(this, module, Key.Name, PrologArity, Key.Origin, paramz,
                                                ReturnType, true));
                }
                catch (AccessViolationException e)
                {
                    PrologCLR.Warn("CallProlog: {0} ex: {1}", this, e);
                    return(null);
                }
                catch (Exception e)
                {
                    PrologCLR.Warn("CallProlog: {0} ex: {1}", this, e);

                    return(null);
                }
            }
        }
Ejemplo n.º 2
0
        //#pragma unsafe
        public override object CallPrologFast(object[] paramz)
        {
            //lock (oneEvtHandlerAtATime)
            {
                try
                {
                    object arg1 =
                        //Key.Origin; //makes sense for UseCallN
                        this;
                    PrologEvents++;
                    if (UseCallN)
                    {
                        return(PrologCLR.CallProlog(this, Key.Module, "call", PrologArity, arg1, paramz, ReturnType,
                                                    false));
                    }
                    string module = Key.Module ?? "user";
                    PrologEvents++;
                    if (!knownDefined && !PrologCLR.IsDefined(module, Key.Name, PrologArity))
                    {
                        PrologCLR.Warn("Undefined Delegate Handler {0}:{1}/{2}", module, Key.Name, PrologArity);
                        return(null);
                    }

                    knownDefined = true;
                    return(PrologCLR.CallProlog(this, module, Key.Name, PrologArity, arg1, paramz,
                                                ReturnType, false));
                }
                catch (AccessViolationException e)
                {
                    PrologCLR.Warn("CallProlog: {0} ex: {1}", this, e);
                    return(null);
                }
                catch (Exception e)
                {
                    PrologCLR.Warn("CallProlog: {0} ex: {1}", this, e);

                    return(null);
                }
            }
        }