IsDefined() 공개 메소드

public IsDefined ( string name ) : bool
name string
리턴 bool
예제 #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);
                }
            }
        }
예제 #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);
                }
            }
        }