public int?AskChoice(string question, List <string> choices, List <string> colors, string includeCustomButton) { return(_engine.Invoke <int?>(() => { var dlg = new ChoiceDlg("Choose One", question, choices, colors, includeCustomButton); int?result = dlg.GetChoice(); return dlg.DialogResult.GetValueOrDefault() ? result: (int?)null; })); }
public int?AskChoice(string question, List <string> choices, List <string> colors, List <string> buttons) { return(QueueAction <int?>(() => { var dlg = new ChoiceDlg("Choose One", question, choices, colors, buttons); int?result = dlg.GetChoice(); return dlg.DialogResult.GetValueOrDefault() ? result : 0; })); }
public int?AskChoice(string question, List <string> choices) { return(_engine.Invoke <int?>(() => { var dlg = new ChoiceDlg("Choose One", question, choices); int result = dlg.GetChoice(); if (result == 0) { return (int?)null; } else { return dlg.DialogResult.GetValueOrDefault() ? result - 1: (int?)null; } })); }