Beispiel #1
0
        private IEnumerable<IArgument> InternExecute(IProgramSequence progSeq)
        {
            IEnumerable<IArgument> result = new IArgument[0];

            foreach (ICommand comm in progSeq.Commands)
            {
                // Get command if exists.
                var match = Resolver.Resolve(comm, Environments);

                // Execute command and combine with other results.
                if (match != null){
                    result = result.Concat(match.ExecuteCommand());
                }
                else
                    throw new UnknownCommandException(comm);
            }

            return result;
        }