예제 #1
0
        public JavaScriptRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException("log");

            if (commandProcessor == null)
                throw new ArgumentNullException("commandProcessor");

            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            Log = log;
            CommandProcessor = commandProcessor;
            EntityContextConnection = entityContextConnection;
            log.Source = "JavaScript Runner";

            JintEngine = new Jint.Engine(cfg =>
            {
                cfg.AllowClr();
                cfg.AllowDebuggerStatement(JavascriptDebugEnabled);
            });
            //JintEngine.Step += async (s, info) =>
            //{
            //    await Log.ReportInfoFormatAsync(CancellationToken.None, "{1} {2}",
            //         info.CurrentStatement.Source.Start.Line,
            //         info.CurrentStatement.Source.Code.Replace(Environment.NewLine, ""));
            //};

        }
예제 #2
0
파일: Solution.cs 프로젝트: derigel23/Nitra
    public void Open(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISolution solution, DocumentManager documentManager, IActionManager actionManager, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, JetPopupMenus jetPopupMenus)
    {
      Debug.Assert(!IsOpened);

      _solution = solution;
      DocumentManager = documentManager;
      _jetPopupMenus = jetPopupMenus;
      changeManager.Changed2.Advise(lifetime, Handler);
      lifetime.AddAction(Close);
      var expandAction = actionManager.Defs.TryGetActionDefById(GotoDeclarationAction.ACTION_ID);
      if (expandAction != null)
      {
        var postfixHandler = new GotoDeclarationHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

        lifetime.AddBracket(
          FOpening: () => actionManager.Handlers.AddHandler(expandAction, postfixHandler),
          FClosing: () => actionManager.Handlers.RemoveHandler(expandAction, postfixHandler));
      }
      
      var findUsagesAction = actionManager.Defs.GetActionDef<FindUsagesAction>();
      var findUsagesHandler = new FindUsagesHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

      lifetime.AddBracket(
        FOpening: () => actionManager.Handlers.AddHandler(findUsagesAction, findUsagesHandler),
        FClosing: () => actionManager.Handlers.RemoveHandler(findUsagesAction, findUsagesHandler));
    }
		public void RegisterProcessor (CommandType type, ICommandProcessor processor)
		{
			if (processors.ContainsKey (type))
				throw new ArgumentException (string.Format ("Command processor for type {0} is already registered", type));

			if (processor != null)
				processors [type] = processor;
		}
 public ArduinoDetails(IRadio radio, ILoggerFactoryAdapter loggerFactory, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
 {
     _radio = radio;
     _logger = loggerFactory.GetLogger(GetType());
     _configuration = configuration;
     _commandProcessor = commandProcessor;
     _registerContainer = registerContainer;
 }
예제 #5
0
 public FindUsagesHandler(Lifetime lifetime, IShellLocks shellLocks, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, XXLanguageXXSolution nitraSolution)
 {
   _lifetime = lifetime;
   _shellLocks = shellLocks;
   _commandProcessor = commandProcessor;
   _changeUnitFactory = changeUnitFactory;
   _nitraSolution = nitraSolution;
 }
 public TransmitPipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, GpioPin cePin)
 {
     _configuration = configuration;
     _commandProcessor = commandProcessor;
     _registerContainer = registerContainer;
     _logger = loggerFactoryAdapter.GetLogger(GetType());
     _cePin = cePin;
 }
예제 #7
0
파일: Command.cs 프로젝트: adamedx/shango
        protected CommandBase(
            ICommandProcessor ParentCommandProcessor,
            ITerminal  Terminal)
        {
            _CommandProcessor = ParentCommandProcessor;

            _Terminal = Terminal;
        }
예제 #8
0
        public static FFprobeSerializerResult Serialize(ICommandProcessor processor)
        {
            if (processor.Status == CommandProcessorStatus.Faulted)
            {
                return null;
            }

            var standardOutputString = processor.StdOut;
            var serializerResult = FFprobeSerializerResult.Create();

            var serializers = new List<IFFprobeSerializer>
                {
                    new FFprobeStreamSerializer(),
                    new FFprobeFormatSerializer()
                };

            serializers.ForEach(serializer =>
                {
                    var serializerStartIndex = 0;

                    while (serializerStartIndex > -1)
                    {
                        var searchingStartTag = string.Format("[{0}]", serializer.Tag);
                        var searchingEndTag = string.Format("[/{0}]", serializer.Tag);

                        var startTagIndex = standardOutputString.IndexOf(searchingStartTag, serializerStartIndex, StringComparison.OrdinalIgnoreCase);
                        if (startTagIndex == -1)
                        {
                            break;
                        }

                        var endTagIndex = standardOutputString.IndexOf(searchingEndTag, startTagIndex + 1, StringComparison.OrdinalIgnoreCase);
                        if (endTagIndex == -1)
                        {
                            break;
                        }

                        var startAt = startTagIndex + searchingStartTag.Length;
                        var lengthOf = endTagIndex - startAt;
                        var unserializedValueString = standardOutputString.Substring(startAt, lengthOf);

                        var rawSerializedValues = FFprobeGeneralSerializer.Serialize(unserializedValueString);

                        var serializedValues = serializer.Serialize(rawSerializedValues);

                        if (serializedValues != null)
                        {
                            var serializerResultItem = FFprobeSerializerResultItem.Create(serializer.Tag, serializedValues);

                            serializerResult.Results.Add(serializerResultItem);
                        }

                        serializerStartIndex = endTagIndex;
                    }
                });

            return serializerResult;
        }
        public void Register(ICommandProcessor commandProcessor)
        {
            var cmd = commandProcessor.Key.ToUpper();

            if (_processors.ContainsKey(cmd))
                throw new Exception(string.Format("The processor for command '{0}' is already registered", cmd));

            _processors.Add(cmd, commandProcessor);
        }
 public ProductsController(IProductTasks productTasks, ICategoryTasks categoryTasks, IProductsQuery productsQuery, 
     ICommandProcessor commandProcessor, ICaptchaTasks captchaTasks)
 {
     _productTasks = productTasks;
     _categoryTasks = categoryTasks;
     _productsQuery = productsQuery;
     _commandProcessor = commandProcessor;
     _captchaTasks = captchaTasks;
 }
 public static void OnSuccessAction(ICommandFactory factory, ICommand command, ICommandProcessor results)
 {
     //results.StdOut
     // - contains the results ffmpeg command line
     System.Console.ForegroundColor = System.ConsoleColor.DarkMagenta;
     System.Console.WriteLine("Succcess");
     System.Console.WriteLine(results.StdOut);
     System.Console.ForegroundColor = System.ConsoleColor.White;
 }
 protected PipeRegisterBase(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, byte address, byte length, byte[] defaultValue, byte pipeNumber, string name = "") :
     base(loggerFactoryAdapter, commandProcessor, length, address, defaultValue, name)
 {
     PipeNumber = pipeNumber;
     Name = string.Format("{0}{1}{2}",
                         GetType().Name,
                         PipeNumber,
                         string.IsNullOrEmpty(name) ? "" : string.Format(" ({0})", name));
     Logger = loggerFactoryAdapter.GetLogger(Name);
 }
 /// <summary>
 /// Initializes a new instance of the BullsAndCowsGame class.
 /// </summary>
 /// <param name="randomNumberProvider">The randomNumberProvider used to generate random numbers.</param>
 /// <param name="scoreboard">The scoreboard used to hold player's scores.</param>
 /// <param name="printer">The printer used for printing messages and different objects.</param>
 /// <param name="commandProcessor">The first command processor in the chain of responsibility.</param>
 public BullsAndCowsGame(
     IRandomNumberProvider randomNumberProvider,
     ScoreBoard scoreboard,
     IPrinter printer,
     ICommandProcessor commandProcessor)
 {
     this.RandomNumberProvider = randomNumberProvider;
     this.ScoreBoard = scoreboard;
     this.Printer = printer;
     this.CommandProcessor = commandProcessor;
 }
 public ReceivePipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, IReceivePipeCollection parent, int pipeId)
 {
     if (PipeId > 5)
         throw new ArgumentOutOfRangeException(nameof(pipeId), "Invalid PipeId number for this Pipe");
     _logger = loggerFactoryAdapter.GetLogger(string.Format("{0}{1}", GetType().Name, pipeId));
     _configuration = configuration;
     _commandProcessor = commandProcessor;
     _registerContainer = registerContainer;
     _parent = parent;
     PipeId = pipeId;
 }
예제 #15
0
        protected override void DoSetUp()
        {
            _mongoDatabase = MongoHelper.InitializeTestDatabase();

            _cirqus = CommandProcessor.With()
                      .EventStore(e => e.UseMongoDb(_mongoDatabase, "events"))
                      .EventDispatcher(e => e.UseConsoleOutEventDispatcher())
                      .Create();

            RegisterForDisposal(_cirqus);
        }
예제 #16
0
 public DealershipEngine(
     ICommandReader commandReader,
     ICommandProcessor commandProcessor,
     IReportPrinter reportPrinter,
     IUserService userService)
 {
     this.commandReader    = commandReader;
     this.commandProcessor = commandProcessor;
     this.reportPrinter    = reportPrinter;
     this.userService      = userService;
 }
예제 #17
0
 public CommandConsumer InitializeENode()
 {
     _sendReplyService = new SendReplyService("CommandConsumerSendReplyService");
     _jsonSerializer   = ObjectContainer.Resolve <IJsonSerializer>();
     _typeNameProvider = ObjectContainer.Resolve <ITypeNameProvider>();
     _commandProcessor = ObjectContainer.Resolve <ICommandProcessor>();
     _repository       = ObjectContainer.Resolve <IRepository>();
     _aggregateStorage = ObjectContainer.Resolve <IAggregateStorage>();
     _logger           = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
     return(this);
 }
예제 #18
0
        public void Register(ICommandProcessor commandProcessor)
        {
            var cmd = commandProcessor.Key.ToUpper();

            if (_processors.ContainsKey(cmd))
            {
                throw new Exception(string.Format("The processor for command '{0}' is already registered", cmd));
            }

            _processors.Add(cmd, commandProcessor);
        }
예제 #19
0
        protected override void DoSetUp()
        {
            _database = MongoHelper.InitializeTestDatabase();

            _commandProcessor = CommandProcessor.With()
                .Logging(l => l.UseMongoDb(_database, "lost"))
                .EventStore(e => e.UseMongoDb(_database, "events"))
                .Create();

            RegisterForDisposal(_commandProcessor);
        }
예제 #20
0
        public static ContainerMetadata Serialize(ICommandProcessor processor)
        {
            if (processor.Status == CommandProcessorStatus.Faulted)
            {
                return null;
            }

            var standardOutputString = processor.StdOut;

            return JsonConvert.DeserializeObject<ContainerMetadata>(standardOutputString);
        }
     public ExpandPostfixTemplateHandler(
 [NotNull] TextControlChangeUnitFactory changeUnitFactory,
 [NotNull] PostfixTemplatesManager templatesManager,
 [NotNull] ILookupWindowManager lookupWindowManager,
 [NotNull] ICommandProcessor commandProcessor)
     {
         myChangeUnitFactory = changeUnitFactory;
         myLookupWindowManager = lookupWindowManager;
         myCommandProcessor = commandProcessor;
         myTemplatesManager = templatesManager;
     }
 public AddressPipeRegister(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, byte address, byte[] defaultValue, byte pipeNumber, string name = "") :
         base(loggerFactoryAdapter, commandProcessor, address, (byte)(pipeNumber <= 1 ? 5 : 1), defaultValue, pipeNumber, name)
 {
     bool transmitPipe = Address == RegisterAddresses.TX_ADDR;
     Name = string.Format("{0}{1}{2}{3}",
                          transmitPipe ? "Transmit" : "Receive",
                          GetType().Name,
                          transmitPipe ? "" : PipeNumber.ToString(),
                          string.IsNullOrEmpty(name) ? "" : string.Format(" ({0})", name));
     Logger = loggerFactoryAdapter.GetLogger(Name);
 }
        public CreateRecommendationModule(ICommandProcessor commandProcessor)
        {
            Contract.Requires(commandProcessor != null);
            
            this.CommandProcessor = commandProcessor;
            
            this.Get[To.CreateRecommendation] = this.HandleGet;

            this.Post[From.CreateRecommendation, runAsync: true] = this.HandlePostWithCsrfValidation;
            
        }
예제 #24
0
        public Engine(IWriter writer, IReader reader, ICommandProcessor processor, IMemoryCacheProvider memCache)
        {
            Guard.WhenArgument(writer, "writer").IsNull().Throw();
            Guard.WhenArgument(reader, "reader").IsNull().Throw();
            Guard.WhenArgument(processor, "processor").IsNull().Throw();
            Guard.WhenArgument(memCache, "memCache").IsNull().Throw();

            this.writer           = writer;
            this.reader           = reader;
            this.commandProcessor = processor;
            this.memCache         = memCache;
        }
예제 #25
0
        public Engine(IReader reader, IWriter writer, ICommandProcessor commandProcessor, IDatabase database)
        {
            Guard.WhenArgument(reader, "reader").IsNull().Throw();
            Guard.WhenArgument(writer, "writer").IsNull().Throw();
            Guard.WhenArgument(commandProcessor, "commandProcessor").IsNull().Throw();
            Guard.WhenArgument(database, "database").IsNull().Throw();

            this.reader           = reader;
            this.writer           = writer;
            this.commandProcessor = commandProcessor;
            this.database         = database;
        }
예제 #26
0
        public void SetCommand(ICommand command)
        {
            if (command == null)
            {
                return;
            }
            _command = command;

            _commandProcessor = _commandProcessorFactory.CreateAdo(_repository, command, _connection, _transaction);

            _dataShapeName = _connection.DataSource + ":" + _connection.Database + ":" + command.CommandType + ":" + command.CommandText;
        }
        public AddressPipeRegister(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, byte address, byte[] defaultValue, byte pipeNumber, string name = "") :
            base(loggerFactoryAdapter, commandProcessor, address, (byte)(pipeNumber <= 1 ? 5 : 1), defaultValue, pipeNumber, name)
        {
            bool transmitPipe = Address == RegisterAddresses.TX_ADDR;

            Name = string.Format("{0}{1}{2}{3}",
                                 transmitPipe ? "Transmit" : "Receive",
                                 GetType().Name,
                                 transmitPipe ? "" : PipeNumber.ToString(),
                                 string.IsNullOrEmpty(name) ? "" : string.Format(" ({0})", name));
            Logger = loggerFactoryAdapter.GetLogger(Name);
        }
예제 #28
0
        public Engine(IFileLogger logger, ICommandProcessor processor, IReader reader, IWriter writer)
        {
            Guard.WhenArgument(logger, "Engine Logger provider").IsNull().Throw();
            Guard.WhenArgument(processor, "Engine Processor provider").IsNull().Throw();
            Guard.WhenArgument(reader, "Engine reader provider").IsNull().Throw();
            Guard.WhenArgument(writer, "Engine writer provider").IsNull().Throw();

            this.logger    = logger;
            this.processor = processor;
            this.reader    = reader;
            this.writer    = writer;
        }
        public AssociationControllerTests()
        {
            _commandProcessorMock    = Substitute.For <ICommandProcessor>();
            _getAssociationsViewMock = Substitute.For <IViewManager <GetAssociationsView> >();
            _getAssociationViewMock  = Substitute.For <IViewManager <GetAssociationView> >();

            _controller = new AssociationController(
                _commandProcessorMock,
                _getAssociationsViewMock,
                _getAssociationViewMock
                );
        }
 protected RegisterBase(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, int length, byte address, byte[] defaultValue, string name = "")
 {
     Logger = loggerFactoryAdapter.GetLogger(GetType());
     _syncRoot = new object();
     Buffer = new byte[length];
     Name = GetType().Name + (string.IsNullOrEmpty(name) ? "" : string.Format(" ({0})", name));
     CommandProcessor = commandProcessor;
     Length = length;
     Address = address;
     DefaultValue = defaultValue;
     IsDirty = false;
 }
        protected override void DoSetUp()
        {
            _commandProcessor = CommandProcessor.With()
                                .EventStore(e => e.Register(c =>
            {
                _inMemoryEventStore = new InMemoryEventStore();
                return(_inMemoryEventStore);
            }))
                                .Create();

            _context = TestContext.Create();
        }
예제 #32
0
        public LoginController(IQueryProcessor queryProcessor,
                               ICommandProcessor commandProcessor,
                               IJwtSecurityTokenHandlerAdapter jwtSecurityTokenHandlerAdapter)
        {
            Argument.ThrowIfNull(() => queryProcessor);
            Argument.ThrowIfNull(() => commandProcessor);
            Argument.ThrowIfNull(() => jwtSecurityTokenHandlerAdapter);

            this.queryProcessor   = queryProcessor;
            this.commandProcessor = commandProcessor;
            this.jwtSecurityTokenHandlerAdapter = jwtSecurityTokenHandlerAdapter;
        }
 protected RegisterBase(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, int length, byte address, byte[] defaultValue, string name = "")
 {
     Logger           = loggerFactoryAdapter.GetLogger(GetType());
     _syncRoot        = new object();
     Buffer           = new byte[length];
     Name             = GetType().Name + (string.IsNullOrEmpty(name) ? "" : string.Format(" ({0})", name));
     CommandProcessor = commandProcessor;
     Length           = length;
     Address          = address;
     DefaultValue     = defaultValue;
     IsDirty          = false;
 }
예제 #34
0
        public CineOrgMutation(
            ICommandProcessor commandProcessor,
            IValidator <CreateMovieCommand> createMovieCommandValidator,
            IValidator <UpdateMovieCommand> updateMovieCommandValidator)
        {
            _commandProcessor            = commandProcessor ?? throw new ArgumentNullException(nameof(commandProcessor));
            _createMovieCommandValidator = createMovieCommandValidator ?? throw new ArgumentNullException(nameof(createMovieCommandValidator));
            _updateMovieCommandValidator = updateMovieCommandValidator ?? throw new ArgumentNullException(nameof(updateMovieCommandValidator));

            FieldAsync <MovieQueryType>("createMovie", arguments: CreateMovieArguments, resolve: ResolveCreateMovie);
            FieldAsync <MovieQueryType>("updateMovie", arguments: UpdateMovieArguments, resolve: ResolveUpdateMovie);
        }
 public SqlHattemSessionFactory(
     ICommandProcessorFactory <SqlHattemSession> commandProcessorFactory,
     INotificationPublisher <SqlHattemSession> notificationPublisher,
     IQueryProcessorFactory <SqlHattemSession> queryProcessorFactory,
     IDbConnectionFactory dbConnectionFactory
     )
 {
     _commandProcessor      = commandProcessorFactory?.Create() ?? throw new ArgumentNullException(nameof(commandProcessorFactory));
     _queryProcessor        = queryProcessorFactory?.Create() ?? throw new ArgumentNullException(nameof(queryProcessorFactory));
     _notificationPublisher = notificationPublisher ?? throw new ArgumentNullException(nameof(notificationPublisher));
     _dbConnectionFactory   = dbConnectionFactory ?? throw new ArgumentNullException(nameof(dbConnectionFactory));
 }
예제 #36
0
        public T4TypingAssist([NotNull] Lifetime lifetime, [NotNull] ISolution solution, [NotNull] ISettingsStore settingsStore,
                              [NotNull] CachingLexerService cachingLexerService, [NotNull] ICommandProcessor commandProcessor, [NotNull] IPsiServices psiServices,
                              [NotNull] ITypingAssistManager typingAssistManager, [NotNull] SkippingTypingAssist skippingTypingAssist,
                              [NotNull] ICodeCompletionSessionManager codeCompletionSessionManager, IExternalIntellisenseHost externalIntellisenseHost)
            : base(solution, settingsStore, cachingLexerService, commandProcessor, psiServices, externalIntellisenseHost)
        {
            _skippingTypingAssist         = skippingTypingAssist;
            _codeCompletionSessionManager = codeCompletionSessionManager;

            typingAssistManager.AddTypingHandler(lifetime, '=', this, OnEqualTyped, IsTypingSmartParenthesisHandlerAvailable);
            typingAssistManager.AddTypingHandler(lifetime, '"', this, OnQuoteTyped, IsTypingSmartParenthesisHandlerAvailable);
        }
예제 #37
0
        public DkpBot(DkpBotConfiguration configuration, DiscordSocketClient client, ICommandProcessor commandProcessor, ILogger <DkpBot> log)
        {
            this.client           = client;
            this.commandProcessor = commandProcessor;
            this.log = log;

            token = configuration.Discord.Token;

            this.client.Log             += LogAsync;
            this.client.Ready           += ReadyAsync;
            this.client.MessageReceived += MessageReceivedAsync;
        }
예제 #38
0
        public Engine(ICommandProcessor commandProcessor, IWriter writer, IReader reader, ILogger logger)
        {
            Guard.WhenArgument(commandProcessor, "commandProcessor").IsNull().Throw();
            Guard.WhenArgument(writer, "writer").IsNull().Throw();
            Guard.WhenArgument(reader, "reader").IsNull().Throw();
            Guard.WhenArgument(logger, "logger").IsNull().Throw();

            this.commandProcessor = commandProcessor;
            this.writer           = writer;
            this.reader           = reader;
            this.logger           = logger;
        }
예제 #39
0
 public FileEnvironment(IClient client,
                        IFileWatcher fileWatcher, ICommandProcessor commandProcessor,
                        Func <IClient, TargetClient.TargetClient> targetClientFactory,
                        Func <IClient, IIncrementalCompiler> incrementalCompilerFactory,
                        ILogger <FileEnvironment> logger) : base(logger)
 {
     Client                       = targetClientFactory(client);
     CommandProcessor             = commandProcessor;
     FileWatcher                  = fileWatcher;
     IncrementalCompiler          = incrementalCompilerFactory(client);
     IncrementalCompiler.RootPath = FileWatcher.WatchPath;
 }
예제 #40
0
 public Engine(
     ICommandParser parser,
     ICommandProcessor processor,
     IBattleShipFactory factory,
     IView view
     )
 {
     this.Parser    = parser;
     this.processor = processor;
     this.factory   = factory;
     this.view      = view;
 }
        protected override void DoSetUp()
        {
            _commandProcessor = CreateCommandProcessor(config => config
                                                       .EventStore(e => _eventStore = e.UseInMemoryEventStore())
                                                       .EventDispatcher(e => e.UseEventDispatcher(c =>
                                                                                                  new ConsoleOutEventDispatcher(c.GetService <IEventStore>())))
                                                       .Options(o =>
            {
                o.AddCommandTypeNameToMetadata();
            }));

            RegisterForDisposal(_commandProcessor);
        }
예제 #42
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandInvoker" /> class.
 /// </summary>
 /// <param name="resolver">The dependency resolver used by actions.</param>
 /// <param name="processor">The start activity.</param>
 /// <exception cref="System.ArgumentNullException">
 /// </exception>
 public CommandInvoker(IServiceResolver resolver, ICommandProcessor processor)
 {
     if (resolver == null)
     {
         throw new ArgumentNullException(nameof(resolver));
     }
     if (processor == null)
     {
         throw new ArgumentNullException(nameof(processor));
     }
     Resolver  = resolver;
     Processor = processor;
 }
예제 #43
0
 public Engine(IReader reader,
               ICommandProcessor processor,
               ICommandParser parser,
               IWriter writer,
               IBreedTypeServices breedService
               )
 {
     this.reader       = reader;
     this.processor    = processor;
     this.parser       = parser;
     this.writer       = writer;
     this.breedService = breedService;
 }
예제 #44
0
 public Application(
     ICommandParser commandParser,
     ICommandProcessor commandProcessor,
     IGlobalLogger globalLogger,
     IGlobalConfiguration globalConfiguration,
     ITerminal terminal)
 {
     _commandParser       = commandParser;
     _commandProcessor    = commandProcessor;
     _globalLogger        = globalLogger;
     _globalConfiguration = globalConfiguration;
     _terminal            = terminal;
 }
예제 #45
0
        /// <summary>
        /// Constructeur
        /// </summary>
        public FoyerviewModel()
        {
            _foyerRepository  = new FoyerRepository();
            _queryProcessor   = new QueryProcessor();
            _commandProcessor = new CommandProcessor();
            ListeDeFoyer      = new ObservableCollection <FoyerListeModel>();

            this._utilisateur = new Utilisateur();
            //Test
            NomNouveaufoyer = "Test";

            ChargerListeFoyer();
        }
예제 #46
0
        protected override void DoSetUp()
        {
            _commandProcessor = CommandProcessor.With()
                                .EventStore(e => _eventStore = e.UseInMemoryEventStore())
                                .EventDispatcher(e => e.UseEventDispatcher(c => new ConsoleOutEventDispatcher()))
                                .Options(o =>
            {
                o.AddCommandTypeNameToMetadata();
            })
                                .Create();

            RegisterForDisposal(_commandProcessor);
        }
        public static void ClassInitialize(TestContext testContext)
        {
            GpioController gpioController = GpioController.GetDefault();
            _irqPin = gpioController.InitGpioPin(25, GpioPinDriveMode.InputPullUp);
            _cePin = gpioController.InitGpioPin(22, GpioPinDriveMode.Output);

            DeviceInformationCollection devicesInfo = DeviceInformation.FindAllAsync(SpiDevice.GetDeviceSelector("SPI0")).GetAwaiter().GetResult();
            _spiDevice = SpiDevice.FromIdAsync(devicesInfo[0].Id, new SpiConnectionSettings(0)).GetAwaiter().GetResult();
            _commandProcessor = new CommandProcessor(_spiDevice); // new MockCommandProcessor();
            _loggerFactoryAdapter = new NoOpLoggerFactoryAdapter();

            _radio = new Radio(_commandProcessor, _loggerFactoryAdapter, _cePin, _irqPin);
        }
        public Engine(
            IReader reader,
            IWriter writer,
            ICommandProcessor processor)
        {
            Guard.WhenArgument(reader, "Reader").IsNull().Throw();
            Guard.WhenArgument(writer, "Writer").IsNull().Throw();
            Guard.WhenArgument(processor, "Processor").IsNull().Throw();

            this.reader    = reader;
            this.writer    = writer;
            this.processor = processor;
        }
        public ProducersViewModel(IQueryProcessor queryProcessor, ICommandProcessor commandProcessor, IMapperProcessor mapperProcessor)
        {
            _mapperProcessor  = mapperProcessor ?? throw new ArgumentNullException(nameof(mapperProcessor));
            _queryProcessor   = queryProcessor ?? throw new ArgumentNullException(nameof(queryProcessor));
            _commandProcessor = commandProcessor ?? throw new ArgumentNullException(nameof(commandProcessor));

            _producers = new ObservableCollection <Models.Producer>(GetProducers());

            ProducersView = CollectionViewSource.GetDefaultView(_producers);
            ProducersView.SortDescriptions.Add(new SortDescription(nameof(Models.Producer.Name), ListSortDirection.Ascending));

            DeleteProducer = new RelayCommand(DeleteProducerHandler);
        }
예제 #50
0
 public ReceivePipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, IReceivePipeCollection parent, int pipeId)
 {
     if (PipeId > 5)
     {
         throw new ArgumentOutOfRangeException(nameof(pipeId), "Invalid PipeId number for this Pipe");
     }
     _logger            = loggerFactoryAdapter.GetLogger(string.Format("{0}{1}", GetType().Name, pipeId));
     _configuration     = configuration;
     _commandProcessor  = commandProcessor;
     _registerContainer = registerContainer;
     _parent            = parent;
     PipeId             = pipeId;
 }
예제 #51
0
        public CommandFullPipeline(
            ICommandBehaviour <TCommand>[] behaviours,
            ICommandPreProcessor <TCommand>[] preProcessors,
            ICommandProcessor <TCommand> processor,
            ICommandPostProcessor <TCommand>[] postProcessors)
        {
            _behaviours     = new BehaviourContext(this, behaviours);
            _preProcessors  = preProcessors;
            _processor      = processor;
            _postProcessors = postProcessors;

            _disposed = false;
        }
        public Configuration(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
        {
            _logger = loggerFactoryAdapter.GetLogger(GetType());
            _commandProcessor = commandProcessor;
            _registerContainer = registerContainer;
            _payloadWidth = Constants.MaxPayloadWidth;

            // Attempt to set DataRate to 250Kbps to determine if this is a plus model
            DataRates oldDataRate = DataRate;
            DataRate = DataRates.DataRate250Kbps;
            _isPlusModel = DataRate == DataRates.DataRate250Kbps;
            DataRate = oldDataRate;

        }
예제 #53
0
		public T4CSharpTypingAssist(
			Lifetime lifetime,
			ISolution solution,
			ICommandProcessor commandProcessor,
			[NotNull] SkippingTypingAssist skippingTypingAssist,
			CachingLexerService cachingLexerService,
			ISettingsStore settingsStore,
			ITypingAssistManager typingAssistManager,
			IPsiServices psiServices,
			IExternalIntellisenseHost externalIntellisenseHost,
			ISmartDocCommentConfiguration smartDocCommentConfiguration)
			: base(
				lifetime, solution, commandProcessor, skippingTypingAssist, cachingLexerService, settingsStore,
				typingAssistManager, psiServices, externalIntellisenseHost, smartDocCommentConfiguration) {
		}
예제 #54
0
        /// <summary>
        /// Executes a scene asynchronously and reports progress.
        /// </summary>
        public SceneRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException("log");

            if (commandProcessor == null)
                throw new ArgumentNullException("commandProcessor");

            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            CommandProcessor = commandProcessor;
            Log = log;
            EntityContextConnection = entityContextConnection;
        }
예제 #55
0
        public ParsedInput(Expression expression, ICommandProcessor processor)
        {
            if (expression == null)
            {
                throw new ArgumentNullException(nameof(expression));
            }

            if (processor == null)
            {
                throw new ArgumentNullException(nameof(processor));
            }

            Expression = expression;
            Processor = processor;
        }
예제 #56
0
 public void Create(params string[] lines)
 {
     _view = Utils.EditorUtil.CreateView(lines);
     _view.Caret.MoveTo(new SnapshotPoint(_view.TextSnapshot, 0));
     _map = new RegisterMap();
     _host = new FakeVimHost();
     _editOpts = new Mock<IEditorOperations>(MockBehavior.Strict);
     _operations = new Mock<IOperations>(MockBehavior.Strict);
     _bufferData = MockObjectFactory.CreateVimBuffer(
         _view,
         "test",
         MockObjectFactory.CreateVim(_map, host: _host).Object,
         _editOpts.Object);
     _processorRaw = new Vim.Modes.Command.CommandProcessor(_bufferData.Object, _operations.Object);
     _processor = _processorRaw;
 }
예제 #57
0
        public TriggerRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException(nameof(log));

            if (commandProcessor == null)
                throw new ArgumentNullException(nameof(commandProcessor));

            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            CommandProcessor = commandProcessor;
            Log = log;
            EntityContextConnection = entityContextConnection;

            Log.Source = "Trigger Runner";
        }
예제 #58
0
 public void Create(params string[] lines)
 {
     _view = Utils.EditorUtil.CreateView(lines);
     _view.Caret.MoveTo(new SnapshotPoint(_view.TextSnapshot, 0));
     _map = new RegisterMap();
     _editOpts = new Mock<IEditorOperations>(MockBehavior.Strict);
     _operations = new Mock<IOperations>(MockBehavior.Strict);
     _operations.SetupGet(x => x.EditorOperations).Returns(_editOpts.Object);
     _statusUtil = new Mock<IStatusUtil>();
     _fileSystem = new Mock<IFileSystem>(MockBehavior.Strict);
     _bufferData = MockObjectFactory.CreateVimBuffer(
         _view,
         "test",
         MockObjectFactory.CreateVim(_map).Object);
     _processorRaw = new Vim.Modes.Command.CommandProcessor(_bufferData.Object, _operations.Object, _statusUtil.Object, _fileSystem.Object);
     _processor = _processorRaw;
 }
        protected override void DoSetUp()
        {
            CirqusLoggerFactory.Current = new ConsoleLoggerFactory(Logger.Level.Warn);

            var mongoDatabase = MongoHelper.InitializeTestDatabase();

            var aalborgEventStore = new MongoDbEventStore(mongoDatabase, "AalborgEvents");
            var hongKongEventStore = new MongoDbEventStore(mongoDatabase, "HongKongEvents");

            CreateCommandProcessor(aalborgEventStore, aalborgEventStore);

            _hongKongViewManager = new MongoDbViewManager<CountingRootView>(mongoDatabase);
            _hongKongCommandProcessor = CreateCommandProcessor(aalborgEventStore, hongKongEventStore, _hongKongViewManager);

            var replicationDelay = TimeSpan.FromSeconds(5);

            CreateAndStartReplication(aalborgEventStore, hongKongEventStore, replicationDelay);
        }
        public Radio(ICommandProcessor commandProcessor, ILoggerFactoryAdapter loggerFactoryAdapter, GpioPin powerPin, GpioPin cePin, GpioPin irqPin = null)
        {
            _syncRoot = new object();
            _operatingMode = OperatingModes.PowerOff;
            _powerPin = powerPin;
            _powerPin.Write(GpioPinValue.Low);

            _cePin = cePin;
            _cePin.Write(GpioPinValue.Low);

            _loggerFactoryAdapter = loggerFactoryAdapter;
            _logger = _loggerFactoryAdapter.GetLogger(GetType());

            _commandProcessor = commandProcessor;
            _commandProcessor.LoggerFactory = _loggerFactoryAdapter;
            _commandProcessor.GetOperatingMode = () => OperatingMode;

            RegisterContainer = new RegisterContainer(_loggerFactoryAdapter, _commandProcessor);
            OperatingMode = OperatingModes.PowerDown;
            RegisterContainer.ResetRegistersToDefault();

            Configuration = new Configuration(_loggerFactoryAdapter, _commandProcessor, RegisterContainer);

            TransmitPipe = new TransmitPipe(_loggerFactoryAdapter, Configuration, _commandProcessor, RegisterContainer, _cePin);
            ReceivePipes = new ReceivePipeCollection(_loggerFactoryAdapter, Configuration, _commandProcessor, RegisterContainer);

            bool useIrq = irqPin != null;
            if (useIrq)
            {
                _irqPin = irqPin;
                _irqPin.Write(GpioPinValue.High);
                _irqPin.ValueChanged += irqPin_ValueChanged;
            }
            ConfigurationRegister configurationRegister = RegisterContainer.ConfigurationRegister;
            configurationRegister.MaximunTransmitRetriesMask = !useIrq;
            configurationRegister.ReceiveDataReadyMask = !useIrq;
            configurationRegister.TransmitDataSentMask = !useIrq;
            configurationRegister.Save();
            OperatingMode = OperatingModes.StandBy;

        }