public void Initialize(ILogger logger, ICommandController commandController, ITaskController taskController, TaskResultView taskResultView) { if (logger == null) { throw new ArgumentNullException("logger"); } if (commandController == null) { throw new ArgumentNullException("commandController"); } if (taskController == null) { throw new ArgumentNullException("taskController"); } if (taskResultView == null) { throw new ArgumentNullException("taskResultView"); } this.logger = logger; this.commandController = commandController; this.taskController = taskController; this.taskResultView = taskResultView; try { commandItemContainer.ItemsSource = commandController.Commands; } catch (Exception ex) { logger.Error(" CommandView.Initialize", ex); } }
public Undo(ICommandController commandController) { this.commandController = commandController; commandController.CanUndoChanged.Subscribe(_ => this.CanExecuteChanged.Raise(this, EventArgs.Empty)); }
/// <summary></summary> /// <param name="connectionModeController"></param> /// <param name="connectionStateController"></param> /// <param name="sendCommandController"></param> /// <param name="writeController"></param> /// <param name="exchangeViewController"></param> public ExchangeGroup(IConnectionModeController connectionModeController, IConnectionStateController connectionStateController, ICommandController sendCommandController, IWriteController writeController, IExchangeViewController exchangeViewController) { if (connectionModeController == null) { throw new ArgumentNullException("connectionModeController"); } if (connectionStateController == null) { throw new ArgumentNullException("connectionStateController"); } if (sendCommandController == null) { throw new ArgumentNullException("sendCommandController"); } if (writeController == null) { throw new ArgumentNullException("writeController"); } if (exchangeViewController == null) { throw new ArgumentNullException("exchangeViewController"); } this._connectionModeController = connectionModeController; this._connectionStateController = connectionStateController; this._sendCommandController = sendCommandController; this._writeController = writeController; this._exchangeViewController = exchangeViewController; }
public GameController(IGameService gameSevice, IPlayerService playerService, ICommandController commandController) { this.gameService = gameSevice; this.playerService = playerService; this.commandController = commandController; CreateGameHistory(); }
public void Initialize(ILogger logger, ICommandController commandController, ITaskController taskController, TaskResultView taskResultView) { if (logger == null) throw new ArgumentNullException("logger"); if (commandController == null) throw new ArgumentNullException("commandController"); if (taskController == null) throw new ArgumentNullException("taskController"); if (taskResultView == null) throw new ArgumentNullException("taskResultView"); this.logger = logger; this.commandController = commandController; this.taskController = taskController; this.taskResultView = taskResultView; try { commandItemContainer.ItemsSource = commandController.Commands; } catch (Exception ex) { logger.Error(" CommandView.Initialize", ex); } }
// Use this for initialization void Start() { Config.SetConfig(config); string[] worpedSteps; ctrl = group.LunchActionSystem(steps, out worpedSteps); LoopExecute(true); group.EventTransfer.onUserError += OnUserError; }
public CommandFactoryManager(ICommandController <TContext> commandController) { // Establish our code contracts. if (commandController == null) { throw new ArgumentNullException("commandController"); } // Set up the internal collections. factories = new Dictionary <HierarchicalPath, ICommandFactory <TContext> >(); }
public MainModel() { modulesMgr = new ModulesMgr(); fileDocumentsMgr = new FileDocumentsMgr(this); recentFilesMgr = new FileDocuments.RecentFilesMgr(); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; // controller handles do/undo history // (design pattern: 'Command') _controller = new CommandController(); }
public static ICommandController GetCommandController() { if (instance == null) { lock (locker) { if (instance == null) { instance = new CommandController(); } } } return(instance); }
/// <summary> /// 传入command名称关联字典 /// </summary> /// <param name="rule"></param> public void LunchActionSystem(Dictionary <string, string[]> rule, UnityAction onLunchOK) { onCommandRegisted = (activeCommands) => { var steps = activeCommands.ConvertAll <string>(x => x.StepName); steps.Sort(); activeCommands = GetIActionCommandList(activeCommands, steps.ToArray()); remoteController = new TreeCommandController(rule, activeCommands); onLunchOK.Invoke(); }; if (commandCtrl.CommandRegisted) { onCommandRegisted.Invoke(commandCtrl.CommandList); } }
/// <summary> /// 设置安装顺序并生成最终步骤 /// </summary> public void LunchActionSystem <T>(T[] steps, UnityAction <T[]> onLunchOK) where T : IActionStap { Debug.Assert(steps != null); onCommandRegisted = (activeCommands) => { var stepsWorp = ConfigSteps <T>(activeCommands, steps);//重新计算步骤 activeCommands = GetIActionCommandList(activeCommands, Array.ConvertAll <IActionStap, string>(stepsWorp, x => x.StapName)); remoteController = new LineCommandController(activeCommands); onLunchOK.Invoke(Array.ConvertAll <IActionStap, T>(stepsWorp, x => (T)x)); }; if (commandCtrl.CommandRegisted) { onCommandRegisted.Invoke(commandCtrl.CommandList); } }
/// <summary> /// 设置安装顺序并生成最终步骤 /// </summary> public void LunchActionSystem(string[] steps, UnityAction <string[]> onLunchOK) { Debug.Assert(steps != null); onCommandRegisted = (activeCommands) => { var stepsWorp = ConfigSteps(activeCommands, steps);//重新计算步骤 activeCommands = GetIActionCommandList(activeCommands, stepsWorp); remoteController = new LineCommandController(activeCommands); onLunchOK.Invoke(stepsWorp); }; if (commandCtrl.CommandRegisted) { onCommandRegisted.Invoke(commandCtrl.CommandList); } }
public async Task <IActionResult> Update([FromBody] Update update) { using (var scope = _provider.CreateScope()) { var provider = scope.ServiceProvider; var commands = _container.GetCommands(); foreach (ICommand command in commands) { ICommandController controller = GetCommandController(command, provider); CommandMatchResult result = await controller.CheckCommand(update); if (result.Equals(CommandMatchResult.Matching)) { break; } } } return(Ok()); }
public MessageProcessor(IConsoleUIComponents consoleUi, ICommandController commandController) { _consoleUI = consoleUi; _commandController = commandController; }
public CommandHandler(ICommandController controller) { this.controller = controller; }