Exemple #1
0
        public static bool IsMethod(string className, string methodName)
        {
            if (className == null)
            {
                return(FunctionDictionary.ContainsKey(methodName));
            }

            SimObject obj = Sim.FindObjectByName <SimObject>(className);

            if (obj == null)
            {
                if (!ClassTypeDictionary.ContainsKey(className))
                {
                    return(false);
                }

                MethodInfo method = ClassTypeDictionary[className]
                                    .GetMethod(methodName, bindingFlags);
                return(method != null && method.DeclaringType.GetCustomAttributes <ConsoleClassAttribute>().Any());
            }

            Type type = GetObjectType(obj.GetClassName(), obj.GetClassNamespace(), obj);

            return(type != null &&
                   type.GetMethod(methodName, bindingFlags) !=
                   null);
        }