Ejemplo n.º 1
0
        private static string GenerateChecker(MethodInfo method, CheckerAttribute checker)
        {
            string checkerField = "";

            checkerField += "[Checker(\"" + checker.Name + "\")]\n";
            checkerField += GenerateLocalization(method);

            checkerField += "public bool " + method.Name + "() { return _object." + method.Name + "(); }\n\n";

            return(checkerField);
        }
Ejemplo n.º 2
0
        private static string GenerateCheckers(MethodInfo[] methods)
        {
            string checkers = "";

            foreach (MethodInfo method in methods)
            {
                CheckerAttribute checker = method.GetCustomAttribute <CheckerAttribute>();

                if (checker != null)
                {
                    checkers += GenerateChecker(method, checker);
                }
            }

            return(checkers);
        }