public IMenu Execute(params string[] args) { string commandName = this.GetType().Name; string menuName = commandName.Substring(0, commandName.Length - "Command".Length); var menu = menuFactory.CreateMenu(menuName); return(menu); }
public IEnumerable <IMenuItemViewModel> CreateMenuItems(object context) { var items = _menuFactory.CreateMenu(ImportMenuItemProvider.ID, context); yield return(new MenuItemViewModel { Header = "Import", Items = items, Order = 2 }); }
public IEnumerable <IMenuItemViewModel> CreateMenuItems(object context) { // Create the items of the custom actions menu by using the IMenuFactory interface. // This will call the IMenuItemProvider implementations registered for the custom menu ID. var items = _menuFactory.CreateMenu(CustomMenuItemProvider.ID, context); yield return(new MenuItemViewModel { Header = "Custom actions", Items = items }); }
public IMenu Execute(params string[] args) { var categoryId = int.Parse(args[0]); var commandName = this.GetType().Name; var menuName = commandName.Substring(0, commandName.Length - "Command".Length); var menu = (IIdHoldingMenu)menuFactory.CreateMenu(menuName); menu.SetId(categoryId); return(menu); }
public IMenu Execute(params string[] args) { string username = args[0]; string password = args[1]; bool success = userService.TryLogInUser(username, password); if (!success) { throw new InvalidOperationException("Invalid Login!"); } return(menuFctory.CreateMenu("MainMenu")); }
public IMenu Execute(params string[] args) { string commandName = this.GetType().Name; string menuName = commandName.Substring(0, commandName.Length - "Command".Length) + "Menu"; IMenu menu = menuFactory.CreateMenu(menuName); if (menu is IIdHoldingMenu idHoldingMenu) { int postId = int.Parse(args[0]); idHoldingMenu.SetId(postId); } return(menu); }
public override decimal Order(IMenuFactory menu) { return(menu.CreateMenu()); }