Esempio n. 1
0
        /// <summary>
        /// Displays a <see cref="TaskDialog"/> in front of the specified window.
        /// </summary>
        /// <param name="owner">A <see cref="Window"/> that represents the owner window of the
        /// task dialog.</param>
        /// <param name="instruction">A <see cref="String"/> that specifies the instruction text
        /// to display.</param>
        /// <param name="content">A <see cref="String"/> that specifies the content text to
        /// display.</param>
        /// <param name="title">A <see cref="String"/> that specifies the title bar text of the
        /// task dialog.</param>
        /// <param name="buttons">A <see cref="TaskDialogButtons"/> value that specifies which
        /// buttons to display.</param>
        /// <param name="icon">A <see cref="TaskDialogIcon"/> value that specifies the icon to
        /// display.</param>
        /// <returns>A <see cref="TaskDialogResult"/> value that specifies which common button
        /// was selected by the user.</returns>
        public static TaskDialogResult ShowModal(Window owner, String instruction, String content,
			                                     String title, TaskDialogButtons buttons,
			                                     TaskDialogIcon icon)
        {
            // Validate arguments
            if (owner == null) {
                throw new ArgumentNullException("owner");
            }

            // Initialize task dialog instance
            TaskDialog taskDialog = new TaskDialog();
            taskDialog.Title = title;
            taskDialog.Instruction = instruction;
            taskDialog.Content = content;
            taskDialog.CommonButtons = buttons;
            taskDialog.DefaultIcon = icon;

            // Show instance and return result
            return taskDialog.ShowModal(owner);
        }
Esempio n. 2
0
        /// <summary>
        /// Displays a <see cref="TaskDialog"/>.
        /// </summary>
        /// <param name="instruction">A <see cref="String"/> that specifies the instruction text
        /// to display.</param>
        /// <param name="content">A <see cref="String"/> that specifies the content text to
        /// display.</param>
        /// <param name="title">A <see cref="String"/> that specifies the title bar text of the
        /// task dialog.</param>
        /// <param name="buttons">A <see cref="TaskDialogButtons"/> value that specifies which
        /// buttons to display.</param>
        /// <param name="icon">A <see cref="TaskDialogIcon"/> value that specifies the icon to
        /// display.</param>
        /// <returns>A <see cref="TaskDialogResult"/> value that specifies which common button
        /// was selected by the user.</returns>
        public static TaskDialogResult Show(String instruction, String content, String title,
			                                TaskDialogButtons buttons, TaskDialogIcon icon)
        {
            // Initialize task dialog instance
            TaskDialog taskDialog = new TaskDialog();
            taskDialog.Title = title;
            taskDialog.Instruction = instruction;
            taskDialog.Content = content;
            taskDialog.CommonButtons = buttons;
            taskDialog.DefaultIcon = icon;

            // Show instance and return result
            return taskDialog.Show();
        }