Пример #1
0
        static int Main(string[] args)
        {
            Console.Title           = "My Rocking App";
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.WriteLine("*************************************");
            Console.WriteLine("**** Welcome to My Rocking App ******");
            Console.WriteLine("*************************************");
            Console.BackgroundColor = ConsoleColor.Black;
            //ShowSomething();
            //StringInterpolation();
            //int i = 0;
            //Out_mod(ref i);
            //Console.WriteLine(i);
            //named_par("one", three: "three", two: "two");
            //simple_array();
            Emp emp = Emp.contractor;

            Console.WriteLine(emp.GetType());
            Console.WriteLine(typeof(Emp));
            //Console.WriteLine(Enum.GetUnderlyingType(emp.GetType()));

            // what's the diff of Enum and enum
            Enum e;

            Console.WriteLine(e.GetType());
            Console.WriteLine(emp.GetType());


            Console.ReadLine();
            return(0);
        }
Пример #2
0
 private static void View()
 {
     Array.Sort(_employers);
     foreach (Employer Emp in _employers)
     {
         Console.WriteLine(" " + Emp.GetType() + " - " + Emp.salary());
     }
     // продемонстрируем работу класса Group через foreach
     // до сортировки
     foreach (Employer Emp in it)
     {
         Console.WriteLine($" - " + Emp.salary());
     }
 }