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);
        }
Esempio n. 2
0
        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);
     //}
 }
Esempio n. 4
0
 public void callCommand(aceCommandEventArgs _args)
 {
     onCommandCalled(this, _args);
 }
Esempio n. 5
0
        public void RunExpression(commandExpression expression)
        {
            aceCommandEventArgs args = MakeArguments(expression, this);

            args.command.callCommand(args);
        }