Example #1
0
 public static void Display <T>(this T settings) where T : ISettings, IDescription
 {
     MyConsole.WriteNewLineGreen($"Current Settings");
     foreach (var setting in settings.GetType().GetProperties())
     {
         var description = settings.GetPropertyDescription(setting.Name);
         var value       = setting.GetValue(settings);
         MyConsole.WriteLine($"{description,-40} {value}");
     }
 }
Example #2
0
        static void Main(string[] args)
        {
            Settings settings = new();

            while (true)
            {
                MyConsole.WriteLine("Hello World!");
                Thread.Sleep(1000);
                settings.Read();
                settings.ReadFromFile();
                settings.Display();

                //settings.BoardLocations = "55555";

                //settings.Save();
                ////settings.SaveToFile();

                //settings.Display();


                //Console.ReadLine();
            }
        }