Example #1
0
        /// <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);
        }
Example #2
0
        private bool ExecuteAssociatedItem()
        {
            PrompterItem prompterItem = prompterItems.FirstOrDefault(x => x.Name == LastCommand.Name);

            if (prompterItem == null)
            {
                return(false);
            }

            prompterItem.Execute(LastCommand);
            return(true);
        }