Beispiel #1
0
        static public void Show()
        {
            ExDeviderV2.Ex3();

            House original = new House();
            House clone    = original.Clone() as House;

            Console.WriteLine("Первая проверка");

            Console.WriteLine(original);
            Console.WriteLine(clone);

            // Изменяем clone.x (при этом original.x не изменится)
            clone.Room   = "your room";
            clone.Toilet = "your toilet";

            // Проверка.
            Console.WriteLine("Вторая проверка после изменения");
            Console.WriteLine(original);
            Console.WriteLine(clone);
        }
        public static void Show()
        {
            ExDeviderV2.Ex3();


            dynamic dict = new Dictionary <dynamic, dynamic>
            {
                { new { Key = "table" }, new { Value = "стол" } },
                { new { Key = "apple" }, new { Value = "яблоко" } },
                { new { Key = "pen" }, new { Value = "ручка" } },
                { new { Key = "pencil" }, new { Value = "карандаш" } },
                { new { Key = "task" }, new { Value = "задание" } },
                { new { Key = "key" }, new { Value = "ключ" } },
                { new { Key = "customer" }, new { Value = "покупатель" } },
                { new { Key = "ship" }, new { Value = "корабль" } },
                { new { Key = "car" }, new { Value = "машина" } },
                { new { Key = "cap" }, new { Value = "чашка" } },
                { "-------------", "----------" },
                { "table2", "стол2" },
                { "apple2", "яблоко2" },
                { "pen2", "ручка2" },
                { "penci2l", "карандаш2" },
                { "task2", "задание2" },
                { "key2", "ключ2" },
                { "customer2", "покупатель2" },
                { "ship2", "корабль2" },
                { "car2", "машина2" },
                { "cap2", "чашка2" }
            };



            foreach (var item in dict)
            {
                Console.WriteLine($"{item.Key}-{item.Value}");
            }
        }