Example #1
0
        static void Add()
        {
            Speciality form;

            Console.WriteLine("Enter name : ");
            string name = Console.ReadLine();

            Console.WriteLine("Enter lastname : ");
            string lastname = Console.ReadLine();

            Console.WriteLine("Enter age : ");
            string age = Console.ReadLine();

            Console.WriteLine("Enter level : ");
            string level = Console.ReadLine();

            Console.WriteLine("Enter team : ");
            string team = Console.ReadLine();

            Console.WriteLine("Enter specialy : ");
            string speciality = Console.ReadLine();

            Console.WriteLine("Enter education : ");
            string education = Console.ReadLine();

            Console.WriteLine("Enter ribbons quantity : ");
            string ribbonsQuantity = Console.ReadLine();

            Console.WriteLine("Enter experience level : ");
            string experience = Console.ReadLine();

            Console.WriteLine("Enter dead lift : ");
            string deadLift = Console.ReadLine();

            Console.WriteLine("Enter bench press : ");
            string benchPress = Console.ReadLine();

            form = new Speciality(name, lastname,
                                  age, level, team, speciality, education,
                                  ribbonsQuantity, experience, deadLift, benchPress);

            ItemAdded += storageItem =>
            {
                Console.WriteLine("~~~~Next form was added~~~~\n");

                storageItem.PrintData(ItemOutputMessage);

                Console.WriteLine("~~~~Next form was added~~~~\n");
            };
            ItemAdded?.Invoke(form);
            ItemAdded -= storageItem =>
            {
                Console.WriteLine("~~~~Next form was added~~~~\n");

                storageItem.PrintData(ItemOutputMessage);

                Console.WriteLine("~~~~Next form was added~~~~\n");
            };

            Storage.Add(form);
        }