Resolve() public method

public Resolve ( ScriptingContext context ) : bool
context ScriptingContext
return bool
Ejemplo n.º 1
0
        protected override bool DoResolve(ScriptingContext context)
        {
            if ((Args == null) || (Args.Count < 1)) {
                context.Print ("Need an argument:{0}", GetCommandList());
                return false;
            }

            Type subcommand_type = (Type)subcommand_type_hash[(string) Args[0]];

            if (subcommand_type == null)
                throw new ScriptingException ("Syntax error");

            subcommand = (DebuggerCommand) Activator.CreateInstance (subcommand_type);

            ArrayList new_args = new ArrayList ();
            for (int i = 1; i < Args.Count; i++)
                new_args.Add (Args [i]);

            DebuggerEngine engine = context.Interpreter.DebuggerEngine;
            subcommand = (DebuggerCommand) engine.ParseArguments (subcommand, new_args);
            if (subcommand == null)
                return false;

            return subcommand.Resolve (context);
        }