public static int?Value(IntOptionType option) { int result; if (intOptions.TryGetValue(option, out result)) { return(result); } else { return(null); } }
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); } } }); }
public static void Set(IntOptionType option, int value) => intOptions[option] = value;