/// <summary> /// Adds a new item to the current instance. /// </summary> /// <param name="prompterItem">The item to be added to the current instance.</param> public void AddItem(PrompterItem prompterItem) { if (prompterItem == null) { throw new ArgumentNullException(nameof(prompterItem)); } prompterItems.Add(prompterItem); }
private bool ExecuteAssociatedItem() { PrompterItem prompterItem = prompterItems.FirstOrDefault(x => x.Name == LastCommand.Name); if (prompterItem == null) { return(false); } prompterItem.Execute(LastCommand); return(true); }