Example #1
0
 /// <summary>
 /// Creates a Gin's instance with the specified behaviors
 /// </summary>
 /// <param name="library">library of command sketches</param>
 /// <param name="log">Log writer (set null for a console log)</param>
 /// <param name="executor">Command executor (set null for the default command executor behavior)</param>
 public Gin(ICommandLibrary library, ILog log = null, IExecutor executor = null)
 {
     this._localTaskIsDone = new ManualResetEvent(true);
     this.Library          = library;
     this._log             = log ?? new ConsoleLog();
     this._executor        = executor ?? new Executor(this.Log);
     this._executor.Log    = this.Log;
     this.Scheduler        = new Scheduler(this._executor, this._log);
     this.Interpreter      = new Interpreter(library);
 }
Example #2
0
 /// <summary>
 /// Adds a command library to the console.
 /// An ICommandLibrary object provides full flexibility for the processing of user entered commands,
 /// but is more complex to implement than an IVocabulary object.
 /// </summary>
 /// <param name="commands"></param>
 public void AddCommands(ICommandLibrary commands)
 {
     shell.AddCommands(commands);
 }
Example #3
0
 public CommandResolver(ICommandLibrary commandLibrary)
 {
     commands = commandLibrary.GetRegisteredCommands();
 }
Example #4
0
 public Interpreter(ICommandLibrary library)
 {
     this.library = library;
 }