public void onMenuCalled(IAceCommand _command, aceCommandEventArgs _args) { IAceLogable logable = _args.logableCaller; //if (logable == null) logable = aceCommons.terminal; //logable.log("Command menu:"); //foreach (var __comm in this.Values) //{ // logable.log(" -" + __comm.commandShortName + " (" + __comm.commandFullname + ") : " + __comm.description); //} //IAceLogableWithInput logableInput = logable as IAceLogableWithInput; //String selectedCommand = ""; //if (logableInput == null) //{ // selectedCommand = Console.ReadLine(); //} else //{ // selectedCommand = logableInput.getInputLine(); //} //commandExpression expression = new commandExpression(selectedCommand, format); //aceCommandEventArgs args = MakeArguments(expression, this); //args.command.callCommand(args); }
public aceCommandEventArgs MakeArguments(commandExpression expression, Object __caller) { IAceCommand command = null; if (ContainsKey(expression.identifier)) { command = this[expression.identifier]; } else { foreach (IAceCommand __c in this.Values) { if (__c.commandFullname.ToLower() == expression.identifier.ToLower()) { command = __c; } } } if (command != null) { aceCommandEventArgs args = new aceCommandEventArgs(aceCommandEventType.unknown, __caller, command, expression.parameters[0]); return(args); } else { return(null); } }
/// <summary> /// Izbacuje u log help instrukcije /// </summary> /// <param name="_command"></param> /// <param name="_args"></param> public void onHelpCalled(IAceCommand _command, aceCommandEventArgs _args) { throw new NotImplementedException(); //aceCommons.log("HELP :: Command line arguments"); //foreach (var __comm in this.Values) //{ // aceCommons.log(" -" + __comm.commandShortName + " : " + __comm.commandFullname); // aceCommons.log(" " + __comm.description); //} }
public void callCommand(aceCommandEventArgs _args) { onCommandCalled(this, _args); }
public void RunExpression(commandExpression expression) { aceCommandEventArgs args = MakeArguments(expression, this); args.command.callCommand(args); }