示例#1
0
        /// <summary>
        /// Asks the user if they are sure about performing some operation and returns true if they indicate yes and
        /// false if they indicate no.
        /// </summary>
        /// <param name="about">The message to display.  'Are you sure?' will be apended.</param>
        /// <returns>true if they indicate yes and false if they indicate no.</returns>
        public bool IsUserSure(ConsoleString about)
        {
            if (about.EndsWith("."))
            {
                about = about.Substring(0, about.Length - 1);
            }

            var response = Prompt(about + ".  Are you sure?", "y", "n");
            if (response.Equals("y", StringComparison.InvariantCultureIgnoreCase) == true)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
示例#2
0
        /// <summary>
        /// Asks the user if they are sure about performing some operation and returns true if they indicate yes and
        /// false if they indicate no.
        /// </summary>
        /// <param name="about">The message to display.  'Are you sure?' will be apended.</param>
        /// <returns>true if they indicate yes and false if they indicate no.</returns>
        public bool IsUserSure(ConsoleString about)
        {
            if (about.EndsWith("."))
            {
                about = about.Substring(0, about.Length - 1);
            }

            var response = Prompt(about + ".  Are you sure?", "y", "n");

            if (response.Equals("y", StringComparison.InvariantCultureIgnoreCase) == true)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }