コード例 #1
0
        /// <summary>
        /// The prompt.
        /// </summary>
        /// <param name="question">
        /// The question.
        /// </param>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="defaultValue">
        /// The default value.
        /// </param>
        /// <param name="inputType">
        /// The input type.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public static string Prompt(string question, string title, string defaultValue = "", InputType inputType = InputType.TEXT)
        {
            var inst = new PromptUserData(question, title, defaultValue, inputType);

            inst.ShowDialog();
            if (inst.DialogResult == true)
            {
                return(inst.ResponseText);
            }

            return(null);
        }
コード例 #2
0
        /// <summary>
        /// The prompt.
        /// </summary>
        /// <param name="question">
        /// The question.
        /// </param>
        /// <param name="title">
        /// The title.
        /// </param>
        /// <param name="defaultValue">
        /// The default value.
        /// </param>
        /// <param name="inputType">
        /// The input type.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public static string Prompt(string question, string title, string defaultValue = "", InputType inputType = InputType.TEXT)
        {
            var inst = new PromptUserData(question, title, defaultValue, inputType);
            inst.ShowDialog();
            if (inst.DialogResult == true)
            {
                return inst.ResponseText;
            }

            return null;
        }