Ejemplo n.º 1
0
        /// <summary>
        /// Create a new instance.
        /// </summary>
        public Runtime()
        {
            var nameValidator = new NameValidator();
            var commandDescriptorGenerator = new CommandAttributeInspector();

            _commandRegistry = new CommandRegistry(nameValidator, commandDescriptorGenerator);

            _commandServices  = new CommandServices();
            _parser           = new Parser();
            _variableReplacer = new VariableReplacer();

            _sessionObjectTypes = new ScopedObjectRegistry();
            _sessionObjectTypes.Register <VariableCollection>();

            _commandRegistry.Register(typeof(Help));
            _commandRegistry.Register(typeof(Var));

            _commandServices.Register(_commandRegistry);
            _commandServices.Register <IPhraseDictionary>(new PhraseDictionary());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Register a session scoped service.
 /// </summary>
 /// <typeparam name="T">The type of the service being registered.</typeparam>
 public void RegisterSessionService <T>()
 {
     _sessionObjectTypes.Register <T>();
 }