コード例 #1
0
ファイル: Dialog.xaml.cs プロジェクト: koen24/screentogif
        /// <summary>
        /// Shows a Yes/No dialog.
        /// </summary>
        /// <param name="title">The title of the window.</param>
        /// <param name="instruction">The main instruction.</param>
        /// <param name="observation">A complementar observation.</param>
        /// <param name="icon">The image of the dialog.</param>
        /// <returns>True if Yes</returns>
        public static bool Ask(string title, string instruction, string observation, Icons icon = Icons.Error)
        {
            var dialog = new Dialog();
            dialog.PrepareAsk(title, instruction, observation, icon);
            var result = dialog.ShowDialog();

            return result.HasValue && result.Value;
        }
コード例 #2
0
ファイル: Dialog.xaml.cs プロジェクト: wst021/ScreenToGif
        /// <summary>
        /// Shows a Yes/No dialog.
        /// </summary>
        /// <param name="title">The title of the window.</param>
        /// <param name="instruction">The main instruction.</param>
        /// <param name="observation">A complementar observation.</param>
        /// <param name="yesAsDefault">If true, the Yes button will receive the initial focus.</param>
        /// <param name="icon">The image of the dialog.</param>
        /// <returns>True if Yes</returns>
        public static bool Ask(string title, string instruction, string observation, bool yesAsDefault = true, Icons icon = Icons.Question)
        {
            var dialog = new Dialog();

            dialog.PrepareAsk(title, instruction, observation.Replace(@"\n", Environment.NewLine).Replace(@"\r", ""), yesAsDefault, icon);
            var result = dialog.ShowDialog();

            return(result.HasValue && result.Value);
        }
コード例 #3
0
ファイル: Dialog.xaml.cs プロジェクト: wst021/ScreenToGif
        /// <summary>
        /// Shows a Ok/Cancel dialog.
        /// </summary>
        /// <param name="title">The title of the window.</param>
        /// <param name="instruction">The main instruction.</param>
        /// <param name="observation">A complementar observation.</param>
        /// <param name="icon">The image of the dialog.</param>
        /// <returns>True if Ok</returns>
        public static bool OkCancel(string title, string instruction, string observation, Icons icon = Icons.Error)
        {
            var dialog = new Dialog();

            dialog.PrepareOkCancel(title, instruction, observation.Replace(@"\n", Environment.NewLine).Replace(@"\r", ""), icon);
            var result = dialog.ShowDialog();

            return(result.HasValue && result.Value);
        }
コード例 #4
0
        /// <summary>
        /// Shows a Ok dialog.
        /// </summary>
        /// <param name="title">The title of the window.</param>
        /// <param name="instruction">The main instruction.</param>
        /// <param name="observation">A complementar observation.</param>
        /// <param name="icon">The image of the dialog.</param>
        /// <returns>True if Ok</returns>
        public static bool Ok(string title, string instruction, string observation, Icons icon = Icons.Error)
        {
            var dialog = new Dialog();

            dialog.PrepareOk(title, instruction, observation, icon);
            var result = dialog.ShowDialog();

            return(result.HasValue && result.Value);
        }
コード例 #5
0
ファイル: Dialog.xaml.cs プロジェクト: dbremner/ScreenToGif
        /// <summary>
        /// Shows a Ok dialog.
        /// </summary>
        /// <param name="title">The title of the window.</param>
        /// <param name="instruction">The main instruction.</param>
        /// <param name="observation">A complementar observation.</param>
        /// <param name="icon">The image of the dialog.</param>
        /// <returns>True if Ok</returns>
        public static bool Ok(string title, string instruction, string observation, Icons icon = Icons.Error)
        {
            var dialog = new Dialog();
            dialog.PrepareOk(title, instruction, observation.Replace(@"\n", Environment.NewLine).Replace(@"\r", ""), icon);
            var result = dialog.ShowDialog();

            return result.HasValue && result.Value;
        }