示例#1
0
        /// <summary>Asks the user to confirm something.</summary>
        public bool confirm(object request)
        {
            // Open the dialogue:
            BlockingDialogue dialogue = BlockingDialogues.Open("confirm", this, request);

            if (dialogue == null)
            {
                // It failed to open.
                // E.g. because 'prevent this page from opening other dialogues' was ticked.
                return(false);
            }

            // Return the response received from the user:
            return(dialogue.OkResponse);
        }
示例#2
0
        /// <summary>Asks the user for some textual information.</summary>
        public string prompt(object request)
        {
            // Open the dialogue:
            BlockingDialogue dialogue = BlockingDialogues.Open("prompt", this, request);

            if (dialogue == null)
            {
                // It failed to open.
                // E.g. because 'prevent this page from opening other dialogues' was ticked.
                return("");
            }

            // Return the response received from the user:
            if (dialogue.Response is string)
            {
                return((string)dialogue.Response);
            }

            // Empty string otherwise
            return("");
        }
示例#3
0
 /// <summary>Alerts the given message.</summary>
 public void alert(object value)
 {
     // Open the dialogue:
     BlockingDialogues.Open("alert", this, value);
 }