public static bool AskOrDefault(Window parentWindow, OptionalQuestion question, params object[] args) { var user = PluginManager.Instance.User; var askQuestion = Config.GetUser(user, question.AskQuestionConfigurationKey, true); if (askQuestion) { var frm = new OptionalQuestionWindow(question, args); frm.Owner = parentWindow; frm.Title = question.QuestionTitle; frm.WindowStartupLocation = WindowStartupLocation.CenterOwner; return frm.ShowDialog().ValueOrFalse(); } else { return Config.GetUser(user, question.ConfigurationKey, true); } }
public static bool AskOrDefault(Window parentWindow, OptionalQuestion question, params object[] args) { var user = PluginManager.Instance.User; var askQuestion = Config.GetUser(user, question.AskQuestionConfigurationKey, true); if (askQuestion) { var frm = new OptionalQuestionWindow(question, args); frm.Owner = parentWindow; frm.Title = question.QuestionTitle; frm.WindowStartupLocation = WindowStartupLocation.CenterOwner; return(frm.ShowDialog().ValueOrFalse()); } else { return(Config.GetUser(user, question.ConfigurationKey, true)); } }
/// <summary> /// Asks the question, and optionally remembers the answer so that the question will be suppressed subsequently /// </summary> /// <param name="parentWindow"></param> /// <param name="args"></param> /// <returns></returns> public bool Ask(Window parentWindow, params object[] args) { return(OptionalQuestionWindow.AskOrDefault(parentWindow, this, args)); }