示例#1
0
            public Command(MethodInfo aMethod, string alias, string hint)
            {
                method = aMethod;

                name      = !string.IsNullOrEmpty(alias) ? alias : method.Name;
                this.hint = hint;

                parms = ConsoleParam.GenerateParams(method);
            }
示例#2
0
            public Command(MethodInfo aMethod)
            {
                method = aMethod;

                var commandAttr = System.Attribute.GetCustomAttribute(method, typeof(ConsoleCommandAttribute), true) as ConsoleCommandAttribute;

                if (commandAttr != null)
                {
                    name = !string.IsNullOrEmpty(commandAttr.alias) ? commandAttr.alias : method.Name;
                    hint = commandAttr.hint;
                }
                else
                {
                    name = method.Name;
                    hint = "";
                }

                parms = ConsoleParam.GenerateParams(method);
            }