/// <summary> /// Starts a simple confirmation dialog /// </summary> /// <param name="descripionText">The warning text to display, <see langword="null" /> for default</param> /// <param name="title">The content of the title bar of the confirmation window, <see langword="null" /> for default</param> /// <param name="confirmByRetyping">Whether the user has to retype a given phrase to confirm the action, recommended for really dangerous actions, <see langword="null" /> for default</param> /// <param name="confirmationText">The text the user has to type to confirm the Action, <see langword="null" /> for default</param> /// <param name="confirmButtonText">The text to display on the continue button, <see langword="null" /> for default</param> /// <param name="cancelButtonText">The text to display on the cancel button, <see langword="null" /> for default</param> /// <param name="icon">The <see cref="SystemSound" /> to play, use <see langword="null" /> for no sound, possible values are obtainable in the <see cref="SystemSounds" /> <see langword="class" /></param> /// <param name="sound">The <see cref="SystemSound"/> to play, when the confirmation dialog pops up, <see langword="null"/> for none</param> /// <returns>Wether the user confirmed that he is is willing to continue</returns> // ReSharper disable once MethodOverloadWithOptionalParameter /* /// <param name="icon">The Icon of the window, use Option.None for default and <see cref="Option"/><<see cref="ImageSource"/>>.<see cref="Option.Some"/>(<see langword="null"/>) to override it not to change the icon </param> */ public static bool Confirm(string descripionText = null, string title = null, bool?confirmByRetyping = null, string confirmationText = null, string confirmButtonText = null, string cancelButtonText = null , OptionalContent <ImageSource> icon = null, OptionalContent <SystemSound> sound = null ) => ShouldSkip(SkipConfiguration) || WindowConfiguration.CreateFromDefaults(descripionText, title, confirmByRetyping, confirmationText, confirmButtonText, cancelButtonText, icon, sound ) .Confirm();
internal ConfirmationWindowConfiguration CreateFromDefaults(string descriptionText, string title, bool?confirmByRetyping, string confirmationText, string confirmButtonText, string abortButtonText , OptionalContent <ImageSource> icon, OptionalContent <SystemSound> sound ) => new ConfirmationWindowConfiguration(true) { ConfirmByRetyping = confirmByRetyping ?? ConfirmByRetyping, Title = title ?? Title, ConfirmationText = confirmationText ?? ConfirmationText, DescriptionText = descriptionText ?? DescriptionText, ConfirmButtonText = confirmButtonText ?? ConfirmButtonText, CancelButtonText = abortButtonText ?? CancelButtonText, Icon = icon ?? Icon, Sound = sound ?? Sound };