Ejemplo n.º 1
0
        /// <summary>
        ///     Creates a Question Dialog with a Date Selector
        ///     The Result Property contains the selected Date
        /// </summary>
        /// <param name="title">The message that will appear in the title bar of the dialog</param>
        /// <param name="question">The message that will appear about the input box on the dialog</param>
        /// <param name="size">The width of this dialog. The default size is 360</param>
        public InputDialogDate(string title, string question, int size) : base(title, size, question)
        {
            var input = Input("inputcontrol", "date");

            input.id = "DialogAnswerBox";
            input.SetBounds("10px", "0px", "90%", "auto");
            input.onchange = ev => { Result = input.value; };
            AnswerDiv.AppendChild(input);
            Create(QuestionSize + 25 + 25 + 78);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Creates a Question Dialog with a checkbox
        ///     The Result Property contains a boolean value of the checkbox state
        /// </summary>
        /// <param name="title">The message that will appear in the title bar of the dialog</param>
        /// <param name="question">The message that will appear about the input box on the dialog</param>
        /// <param name="size">The width of this dialog. The default size is 360</param>
        public InputDialogCheckbox(string title, string question, int size) : base(title, size, question)
        {
            var input = Input("inputcontrol", "checkbox");

            input.id = "DialogAnswerBox";
            input.SetBounds("10px", "0px", "90%", "40px");
            input.onchange = ev =>
            {
                Result = input.@checked;
            };
            AnswerDiv.AppendChild(input);
            Create(QuestionSize + 40 + 25 + 78);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Creates a Question Dialog with a Date Selector
        ///     The Result Property contains the selected Date
        /// </summary>
        /// <param name="title">The message that will appear in the title bar of the dialog</param>
        /// <param name="question">The message that will appear about the input box on the dialog</param>
        /// <param name="size">The width of this dialog. The default size is 360</param>
        public InputDialogDateTimeLocal(string title, string question, int size) : base(title, size, question)
        {
            Result = DateTime.Now;
            var input = Input("inputcontrol", "dateTimeLocal");

            input.id = "DialogAnswerBox";
            input.SetBounds("10px", "0px", "90%", "auto");
            input.onchange = ev =>
            {
                Result = DateTime.ParseExact(input.value, "yyyy-MM-ddTHH:mm", CultureInfo.InvariantCulture);
            };
            AnswerDiv.AppendChild(input);
            Create(QuestionSize + 25 + 25 + 78);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Creates a Question Dialog with an email input
        ///     The Result Property contains the Entered email
        /// </summary>
        /// <param name="title">The message that will appear in the title bar of the dialog</param>
        /// <param name="question">The message that will appear about the input box on the dialog</param>
        /// <param name="size">The width of this dialog. The default size is 360</param>
        public InputDialogEmail(string title, string question, int size) : base(title, size, question)
        {
            var input = Input("inputcontrol", "email");

            input.id = "DialogAnswerBox";
            input.SetBounds("10px", "0px", "90%", "auto");
            input.onchange = ev =>
            {
                //todo css for email input not showing up
                //todo could always validate email here
                Result = input.value;
            };
            AnswerDiv.AppendChild(input);
            Create(QuestionSize + 25 + 25 + 78);
        }