Example #1
0
        /// <summary>
        /// Shows a dialog that presents the user with a message and a text box
        /// </summary>
        /// <param name="options">the options used to configure the dialog</param>
        /// <returns>a promise that resolves with the value of the text box at the time of dismissal. This promise never rejects.</returns>
        public static Promise <ConsoleString> ShowRichTextInput(RichTextDialogOptions options)
        {
            var d = Deferred <ConsoleString> .Create();

            var rawPromise = new Dialog(options).Show();

            rawPromise.Then(() => d.Resolve(options.TextBox.Value));
            return(d.Promise);
        }
Example #2
0
        /// <summary>
        /// Shows a dialog with a message and a set of options for the user to choose from
        /// </summary>
        /// <param name="options">the options used to configure the dialog</param>
        /// <returns>a promise that resolves with the selected option or null if the dialog was cancelled. The promise never rejects.</returns>
        public static Promise <DialogOption> ShowMessage(DialogButtonOptions options)
        {
            var d = Deferred <DialogOption> .Create();

            var rawPromise = new Dialog(options).Show();

            rawPromise.Then(() => d.Resolve(options.SelectedOption));
            return(d.Promise);
        }