public void Configure(ICommandMap commandMap, IActionMap actionMap) { Debug.Assert(commandMap != null); Debug.Assert(actionMap != null); _commandMap = commandMap; _actionMap = actionMap; }
public bool Register(ICommandMap commandMap) { if (AllowChangesFrom(commandMap)) { this.commandMap = commandMap; return(true); } return(false); }
public void RunBeforeEachTest() { eventDispatcher = new EventDispatcher(); injector = new UnityInjector(); reflector = new UnityReflector(); commandMap = new CommandMap( eventDispatcher, injector, reflector ); //TODO Use the Unity lifetimemanager here injector.MapValue( typeof(ICommandTest), this ); }
public bool Unregister(ICommandMap commandMap) { if (AllowChangesFrom(commandMap)) { this.commandMap = null; this.activeAliases = new List <string>(this.aliases); this.label = this.nextLabel; return(true); } return(false); }
protected Context(BaseViewSettings viewSettings) { Injector = new Injector(); EventDispatcher = new EventDispatcher(); CommandMap = new CommandMap(Injector, EventDispatcher); Injector.MapValue(Injector); Injector.MapValue(EventDispatcher); Injector.MapValue(viewSettings); Startup(); }
private void PostConfigs() { ICommandMap commandMap = context.Mapper.GetMappingValue <ICommandMap>() as ICommandMap; IMediatorMapper mediatorMap = context.Mapper.GetMappingValue <IMediatorMapper>() as IMediatorMapper; //Commands commandMap.Map <GetToDoItemsEvent>(GetToDoItemsEvent.Type.Get).ToCommand <GetToDoCommand>(); commandMap.Map <GetCompleteItemsEvent>(GetCompleteItemsEvent.Type.Get).ToCommand <GetCompletedItemsCommand>(); commandMap.Map <EditToDoItemsEvent>(EditToDoItemsEvent.Type.Add).ToCommand <AddItemCommand>(); commandMap.Map <EditToDoItemsEvent>(EditToDoItemsEvent.Type.Complete).ToCommand <CompleteItemCommand>(); //Mediators mediatorMap.Map <ConsoleView>().ToMediator <ConsoleMediator>(); //Models context.Mapper.Map <IToDoModel>().ToValue(new ToDoModel()); }
private bool AllowChangesFrom(ICommandMap commandMap) { return(null == this.commandMap || this.commandMap == commandMap); }
/// <summary> /// Public constructor. A ToolbarCommandExecuter reacts to click events /// of a menu view and runs associated commands. /// </summary> /// <param name="map">A command map that associates string identifiers or key shortcuts to specific commands.</param> /// <param name="view">The menu controlled by the current presenter.</param> public AppToolbarPresenter(ICommandMap map, IAppToolbar view) { _map = map; _view = view; _view.Presenter = this; }
public SingleButtonViewModel(ICommandMap commands, IDialogService dialService) { _commands = commands; _diagService = dialService; _commands.AddCommand("ShowWindowCommand", ShowWindow); }