Exemple #1
0
        public static IValue GetParentContext(IExecutionContext ctx, IList<IArgument> arguments)
        {
            var args = CommandUtilities.ManageArguments(arguments)
                .Exactly(0)
                .Results();

            return new GenericValue<IExecutionContext>(ctx.GetParentContext());
        }
Exemple #2
0
        public static IValue DefineModule(IExecutionContext ctx, IList<IArgument> arguments)
        {
            var args = CommandUtilities.ManageArguments(arguments)
                .Exactly(1)
                .CanConvert<string>()
                .Results();

            IExecutionContext parent = ctx.GetParentContext() ?? ctx;
            parent.DefineVariable(args[0].GetValue<string>(), new BasicVariable() { Value = new GenericValue<IExecutionContext>(ctx) });
            return new GenericValue<bool>(true);
        }