Пример #1
0
        public static int?Value(IntOptionType option)
        {
            int result;

            if (intOptions.TryGetValue(option, out result))
            {
                return(result);
            }
            else
            {
                return(null);
            }
        }
Пример #2
0
 public static OptionEditInfo GetEditInfo(IntOptionType option, string text, int maxDigits = 4)
 {
     return(new OptionEditInfo {
         Text = text,
         GetValue = () => Option.Value(option)?.ToString() ?? "",
         EditValue = (row, col) => {
             int?value = EnterInt(row, col, maxDigits);
             if (value != null)
             {
                 Option.Set(option, value.Value);
             }
         }
     });
 }
Пример #3
0
 public static void Set(IntOptionType option, int value) => intOptions[option]    = value;