Пример #1
0
        public static String Ask(String key, String question)
        {
            if (question == null)
            {
                throw new ArgumentNullException(nameof(question));
            }
            if (key == null)
            {
                throw new ArgumentNullException(nameof(key));
            }
            Object value;

            while (!Settings.TryGetValue(key, out value))
            {
                var questionBox = new QuestionBox(question);
                var result      = questionBox.ShowDialog();
                if (result == DialogResult.OK)
                {
                    Settings[key] = questionBox.Response;
                }
                else
                {
                    if (ThreadingExtensions.IsRunningFromNUnit)
                    {
                        throw new NotImplementedException();
                    }
                }
            }
            return(value as String);
        }