Ejemplo n.º 1
0
        protected Kernel(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                throw new ArgumentException("Value cannot be null or whitespace.", nameof(name));
            }

            Name = name;

            SubmissionParser = new SubmissionParser(this);

            _disposables = new CompositeDisposable();

            Pipeline = new KernelCommandPipeline(this);

            AddCaptureConsoleMiddleware();

            AddSetKernelMiddleware();

            AddDirectiveMiddlewareAndCommonCommandHandlers();

            _disposables.Add(Disposable.Create(
                                 () => _kernelEvents.OnCompleted()
                                 ));
        }
Ejemplo n.º 2
0
        protected KernelBase()
        {
            _disposables = new CompositeDisposable();

            Pipeline = new KernelCommandPipeline(this);

            AddSetKernelMiddleware();

            AddDirectiveMiddlewareAndCommonCommandHandlers();
        }
Ejemplo n.º 3
0
        protected KernelBase()
        {
            _disposables = new CompositeDisposable();

            Pipeline = new KernelCommandPipeline(this);

            AddSetKernelMiddleware();

            AddCaptureConsoleMiddleware();

            AddDirectiveMiddlewareAndCommonCommandHandlers();

            _disposables.Add(_kernelEvents);
        }
Ejemplo n.º 4
0
        protected KernelBase()
        {
            _disposables = new CompositeDisposable();

            Pipeline = new KernelCommandPipeline(this);

            AddSetKernelMiddleware();

            AddDirectiveMiddlewareAndCommonCommandHandlers();

            _disposables.Add(_idleState.IdleState.Subscribe(idle =>
            {
                if (idle)
                {
                    PublishEvent(new KernelIdle());
                }
                else
                {
                    PublishEvent(new KernelBusy());
                }
            }));
        }