/// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="reader">Interface for reading a command set.</param>
 /// <param name="dispatcherFactory">Interface for creating objects to dispatch a command set.</param>
 public CommandSetInterpreter(ICommandSetReader reader, ICommandSetDispatcherFactory dispatcherFactory)
 {
     this.reader            = reader ?? throw new ArgumentNullException(nameof(reader));
     this.dispatcherFactory = dispatcherFactory ?? throw new ArgumentNullException(nameof(dispatcherFactory));
 }
Beispiel #2
0
        /// <summary>
        /// Executes a command set.
        /// </summary>
        /// <param name="reader">Reads commands from where they are stored.</param>
        /// <param name="dispatcherFactory">Factory that creates a dispatcher to execute the commands.</param>
        private static void RunCommandSet(ICommandSetReader reader, ICommandSetDispatcherFactory dispatcherFactory)
        {
            var interpreter = new CommandSetInterpreter(reader, dispatcherFactory);

            interpreter.Interpret();
        }