ScreenToGif.Windows.Other.Dialog.Ask C# (CSharp) Метод

Ask() публичный статический Метод

Shows a Yes/No dialog.
public static Ask ( string title, string instruction, string observation, Icons icon = Icons.Error ) : bool
title string The title of the window.
instruction string The main instruction.
observation string A complementar observation.
icon Icons The image of the dialog.
Результат bool
        public static bool Ask(string title, string instruction, string observation, Icons icon = Icons.Error)
        {
            var dialog = new Dialog();
            dialog.PrepareAsk(title, instruction, observation.Replace(@"\n", Environment.NewLine).Replace(@"\r", ""), icon);
            var result = dialog.ShowDialog();

            return result.HasValue && result.Value;
        }

Usage Example

Пример #1
0
        private void Delete(History history)
        {
            if (!Dialog.Ask(Title, LocalizationHelper.Get("S.Options.Upload.History.Delete.Instruction"), LocalizationHelper.Get("S.Options.Upload.History.Delete.Message")))
            {
                return;
            }

            CurrentPreset?.History.Remove(history);
            DataGrid.ItemsSource   = null;
            DataGrid.ItemsSource   = CurrentPreset?.History;
            DataGrid.SelectedIndex = 0;
        }
All Usage Examples Of ScreenToGif.Windows.Other.Dialog::Ask