public AircraftTypeMutations(ICommandRouter commandRouter,
                              IAircraftTypeReadRepository aircraftTypeReadRepository
                              )
 {
     _aircraftTypeReadRepository = aircraftTypeReadRepository;
     _commandRouter = commandRouter;
 }
Example #2
0
 public ApplicationServer(
     ICommandRouter commandRouter,
     ILogger logger)
 {
     _commandRouter = commandRouter;
     _logger = logger;
 }
 public CommandHandlerDiscovery(ITypeExplorer typeExplorer, StandardKernel kernel,
                                ICommandRouter commandRouter)
 {
     this.typeExplorer  = typeExplorer;
     this.kernel        = kernel;
     this.commandRouter = commandRouter;
 }
Example #4
0
        protected GlobalCommand(ICommandRouter commandRouter, IMessageHelper messageHelper)
        {
            CommandRouter = commandRouter;
            MessageHelper = messageHelper;

            Name = GetType().UnderlyingSystemType.Name;
        }
Example #5
0
 public void SetUp()
 {
     _commandRouter  = Substitute.For <ICommandRouter>();
     _consumer       = (TConsumer)Activator.CreateInstance(typeof(TConsumer), _commandRouter);
     _consumeContext = Substitute.For <ConsumeContext <TCommand> >();
     _command        = new TCommand();
     _consumeContext.Message.Returns(_command);
 }
        protected AbstractCommandIntegrationTest()
        {
            MockUserService = A.Fake <IUserService>();

            var handlerFactory = new TestCommandHandlerFactory(MockUserService);

            CommandRouter = new CommandRouter(handlerFactory);
        }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GolfClubMembershipDomainEventHandler" /> class.
 /// </summary>
 /// <param name="commandRouter">The command router.</param>
 /// <param name="manager">The manager.</param>
 /// <param name="eventTypesToSilentlyHandle">The event types to silently handle.</param>
 public GolfClubMembershipDomainEventHandler(ICommandRouter commandRouter,
                                             IManagmentAPIManager manager,
                                             IDomainEventTypesToSilentlyHandle eventTypesToSilentlyHandle)
 {
     this.CommandRouter = commandRouter;
     this.Manager       = manager;
     this.EventTypesToSilentlyHandle = eventTypesToSilentlyHandle;
 }
Example #8
0
 public void SetUp()
 {
     _commandRouter       = Substitute.For <ICommandRouter>();
     _testCommandConsumer = new TestCommandConsumer(_commandRouter);
     _consumeContext      = Substitute.For <ConsumeContext <TestCommand> >();
     _testCommand         = new TestCommand();
     _consumeContext.Message.Returns(_testCommand);
 }
Example #9
0
 public PlanningMutations(
     ICommandRouter commandRouter,
     IPlanningReadRepository planningReadRepository,
     IAppSettingsRetriever appSettingsRetriever)
 {
     _planningReadRepository = planningReadRepository;
     _appSettingsRetriever   = appSettingsRetriever;
     _commandRouter          = commandRouter;
 }
 public CommandProcessor(
     IMessageReceiver messageReceiver,
     ICommandRouter commandRouter,
     ITextSerializer serializer)
 {
     _messageReceiver = messageReceiver;
     _commandRouter = commandRouter;
     _serializer = serializer;
 }
Example #11
0
 public MainForm(ICommandRouter router)
 {
     InitializeComponent();
     InitializeCommandBindings(router);
     InitializeSupportedCommands(router);
     FirstResult = 0;
     MaxResults = 100;
     toolStripTextBoxFirst.Control.DataBindings.Add("Text", this, "FirstResult");
     toolStripTextBoxMax.Control.DataBindings.Add("Text", this, "MaxResults");
 }
Example #12
0
        public LogModel(ILog log,ICommandRouter router)
        {
            Hierarchy h = LogManager.GetRepository() as Hierarchy;
            h.Root.AddAppender(this);
            h.Root.Level = Level.Debug;
            this.log = log;
            router.ExceptionExecuting += new EventHandler<ExecutingExceptionEventArgs>(router_ExceptionExecuting);

            channel = new IpcChannel("log4net");

            ChannelServices.RegisterChannel(channel,false);
            oref = RemotingServices.Marshal(this, null);
            ApplicationEnvironment.Instance.LoggerURI = channel.GetUrlsForUri(oref.URI)[0];
        }
Example #13
0
 public LogView(MainForm form,LogModel model,ICommandRouter router)
 {
     InitializeComponent();
     router.PreExecute += new EventHandler(router_PreExecute);
     this.model = model;
     ShowHint = DockState.DockBottom;
     Show(form.DockPanel);
     listViewMessages.VirtualMode = true;
     model.ErrorsCountChanged += new EventHandler(model_ErrorsCountChanged);
     model.MessagesCountChanged += new EventHandler(model_MessagesCountChanged);
     model.WarningsCountChanged += new EventHandler(model_WarningsCountChanged);
     model.DebugsCountChanged += new EventHandler(model_DebugsCountChanged);
     listViewMessages.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(listView1_RetrieveVirtualItem);
     model_WarningsCountChanged(this, EventArgs.Empty);
     model_ErrorsCountChanged(this, EventArgs.Empty);
     model_MessagesCountChanged(this, EventArgs.Empty);
     model_DebugsCountChanged(this, EventArgs.Empty);
     warningButton.Click += new EventHandler(choicheButton_Click);
     messageButton.Click += new EventHandler(choicheButton_Click);
     errorButton.Click += new EventHandler(choicheButton_Click);
     debugButton.Click += new EventHandler(choicheButton_Click);
     SetVirtualSize();
 }
 public ArchiveManagerService(ICommandRouter commandRouter)
 {
     _commandRouter = commandRouter;
 }
Example #15
0
 public MarkFoodServedConsumer(ICommandRouter commandRouter)
     : base(commandRouter)
 {
 }
Example #16
0
 // Ask for options to configure loop
 public ResourceAndStateManagerService(ICommandRouter commandRouter)
 {
     _commandRouter = commandRouter;
 }
Example #17
0
 public TargetableCommand(Command command)
 {
     _command = command;
     _commandRouter = IoC.Get<ICommandRouter>();
 }
 public PlaceOrderConsumer(ICommandRouter commandRouter)
     : base(commandRouter)
 {
 }
Example #19
0
        private void InitializeCommandBindings(ICommandRouter router)
        {
            router.BindToUI(DefinedCommands.NewProject, newProject1ToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.NewProject, newProjectToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.SaveProject, toolStripButtonSaveProject, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.SaveProject, toolStripMenuItemSaveProject, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.SaveProjectAs, toolStripMenuItemSaveProjectAs, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.OpenProject, this.openProjectToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.OpenProject, this.openProjectToolStripMenuItem1, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Save, this.saveToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.Save, this.saveToolStripButton, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.SaveAs, this.saveAsToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.SelectAll, this.selectAllToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Copy, this.copyToolStripButton, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.Copy, this.copyToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Cut, this.cutToolStripButton, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.Cut, this.cutToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Paste, this.pasteToolStripButton, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.Paste, this.pasteToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Undo, this.undoToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Redo, this.redoToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.NewConfig, this.newConfigToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.NewConfig, this.configToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.NewMapping, this.newMappingToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.NewMapping, this.mappingToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.NewHql, this.newHqlToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.NewHql, this.hqlToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.OpenFile, this.openFileToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.OpenFile, this.openToolStripMenuItem, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.CreateProbe, this.buildProbeToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.CreateProbe, this.toolStripButtonBuildProbe, "Click", (i, e) => i.Enabled = e);

            router.BindToUI(DefinedCommands.Run, this.startToolStripMenuItem, "Click", (i, e) => i.Enabled = e);
            router.BindToUI(DefinedCommands.Run, this.toolStripButtonStart, "Click", (i, e) => i.Enabled = e);
        }
 public SupplementController(ICommandRouter commandRouter, IQueryRouter queryRouter) : base(commandRouter, queryRouter)
 {
 }
 public ScheduleController(ICommandRouter commandRouter, IQueryRouter queryRouter) : base(commandRouter,
                                                                                          queryRouter)
 {
 }
Example #22
0
 public CommandPackage(ICommandRouter commandRouter, IMessageHelper messageHelper) : base(commandRouter, messageHelper)
 {
 }
Example #23
0
 public CommandGateway(ICommandRouter commandRouter)
 {
     this.commandRouter = commandRouter;
 }
Example #24
0
 public TargetableCommand(Command command)
 {
     _command       = command;
     _commandRouter = IoC.Get <ICommandRouter>();
 }
        /// <summary>
        /// Specify a rate limit for message processing, so that only the specified number of messages are allowed
        /// per interval.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="configurator"></param>
        /// <param name="rateLimit">The number of messages allowed per interval</param>
        /// <param name="interval">The reset interval for each set of messages</param>
        /// <param name="router">The control pipe used to adjust the rate limit dynamically</param>
        public static void UseRateLimit <T>(this IPipeConfigurator <T> configurator, int rateLimit, TimeSpan interval, ICommandRouter router = null)
            where T : class, PipeContext
        {
            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var specification = new RateLimitPipeSpecification <T>(rateLimit, interval, router);

            configurator.AddPipeSpecification(specification);
        }
Example #26
0
 private void InitializeSupportedCommands(ICommandRouter router)
 {
     bindings = new CommandBinding[]
     {
         new CommandBinding(){ Command=DefinedCommands.NewConfig, CanExecute=()=>true, Execute=()=>{if(null!=NewConfig) NewConfig(this,EventArgs.Empty);}}
         ,new CommandBinding(){ Command=DefinedCommands.NewHql, CanExecute=()=>true, Execute=()=>{if(null!=NewHql) NewHql(this,EventArgs.Empty);}}
         ,new CommandBinding(){ Command=DefinedCommands.NewMapping, CanExecute=()=>true, Execute=()=>{if(null!=NewMapping) NewMapping(this,EventArgs.Empty);}}
         ,new CommandBinding(){ Command=DefinedCommands.OpenFile, CanExecute=()=>true, Execute=()=>{if(null!=OpenFile) OpenFile(this,EventArgs.Empty);}}
     };
     router.Register(this);
 }
Example #27
0
        public ConcurrencyLimitPipeSpecification(int concurrencyLimit, ICommandRouter router = null)
        {
            _concurrencyLimit = concurrencyLimit;

            _router = router;
        }
Example #28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TournamentController" /> class.
 /// </summary>
 /// <param name="commandRouter">The command router.</param>
 /// <param name="manager">The manager.</param>
 public TournamentController(ICommandRouter commandRouter, IManagmentAPIManager manager)
 {
     this.CommandRouter = commandRouter;
     this.Manager       = manager;
 }
Example #29
0
 public OrderController(ICommandRouter commandRouter, IQueryRouter queryRouter) : base(commandRouter,
                                                                                       queryRouter)
 {
 }
Example #30
0
 public BaseController(ILogger logger, IQueryRouter queryRouter, ICommandRouter commandRouter)
 {
     _logger        = logger;
     _queryRouter   = queryRouter;
     _commandRouter = commandRouter;
 }
 public ModuleStateManagerService(ICommandRouter commandRouter)
 {
     _commandRouter = commandRouter;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GolfClubController" /> class.
 /// </summary>
 /// <param name="commandRouter">The command router.</param>
 /// <param name="manager">The manager.</param>
 public GolfClubController(ICommandRouter commandRouter,
                           IManagmentAPIManager manager)
 {
     this.CommandRouter = commandRouter;
     this.Manager       = manager;
 }
Example #33
0
 public ConfigController(ILogger logger, IQueryRouter queryRouter, ICommandRouter commandRouter, IOptions<MongoDBPersistenceConfiguration> mongoConfig) : base(logger, queryRouter, commandRouter)
 {
     _mongoConfig = mongoConfig;
 }
Example #34
0
 public static void Initialize(IRepository repository)
 {
     Repository    = repository;
     CommandRouter = new CommandRouter(typeof(DomainLayer).Assembly);
 }
 public MarineUnitMutations(ICommandRouter commandRouter,
                            IMarineUnitReadRepository marineUnitReadRepository)
 {
     _marineUnitReadRepository = marineUnitReadRepository;
     _commandRouter            = commandRouter;
 }
Example #36
0
 public ModuleController(ILogger logger, IQueryRouter queryRouter, ICommandRouter commandRouter, IKubectlHelper kubectlHelper, IProcessLockRepository processLockRepository) : base(logger, queryRouter, commandRouter)
 {
     _kubectlHelper         = kubectlHelper;
     _processLockRepository = processLockRepository;
 }
Example #37
0
 public DirectBus(ICommandRouter commandRouter)
 {
     this.CommandRouter = commandRouter;
 }
 public ShiftController(ICommandRouter commandRouter, IQueryRouter queryRouter) : base(commandRouter,
                                                                                       queryRouter)
 {
 }
Example #39
0
 public AirportMutations(ICommandRouter commandRouter, IAirportReadRepository airportReadRepository)
 {
     _commandRouter         = commandRouter;
     _airportReadRepository = airportReadRepository;
 }