Beispiel #1
0
        public static T GetOption <T>(string title = null) where T : Enum
        {
            var dictionary = MenuTools.GetList(typeof(T));

            Console.WriteLine($@"
>>>>>>>>{title ?? "请选择操作项:"}
{string.Join("\n", dictionary.Select((pair => $"{pair.Value}.{pair.Key}")))}
");

            return((T)Enum.Parse(typeof(T), Console.ReadLine()));
        }
Beispiel #2
0
 private void InitData()
 {
     DbTypes = MenuTools.GetList(typeof(DbTypes));
 }