Exemplo n.º 1
0
        private void FindCmdMethod(string command, out MethodInfo minfo, out ConsoleMethod cmethod)
        {
            MethodInfo[] methods = CommandMethods;

            minfo   = null;
            cmethod = null;

            foreach (MethodInfo method in methods)
            {
                ConsoleMethod[] attributes = method.GetCustomAttributes(typeof(ConsoleMethod), false) as ConsoleMethod[];
                if (attributes != null && attributes.Length > 0)
                {
                    if (attributes[0].Command == command)
                    {
                        minfo   = method;
                        cmethod = attributes[0];
                    }
                }
            }
        }
Exemplo n.º 2
0
        private string GetCommandDescr(MethodInfo minfo)
        {
            ConsoleMethod attribute = GetAttribute(minfo);

            return(attribute != null ? attribute.Description : string.Empty);
        }
Exemplo n.º 3
0
        private string GetCommandName(MethodInfo minfo)
        {
            ConsoleMethod attribute = GetAttribute(minfo);

            return(attribute != null ? attribute.Command : string.Empty);
        }