Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            SuperList <string> superList = new SuperList <string>();

            superList.Push("first");
            if (superList.Search("first") == "first")
            {
                Console.WriteLine("Значение first содержится в коллекции");
            }

            superList.Search("second");
            Console.WriteLine();

            //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

            string[] strArray = { "Artemy", "Is", "The", "Best" };

            var sortedArray = strArray.Where(word => word[0] == 'B' && word.Length == 4);

            foreach (string item in sortedArray)
            {
                Console.WriteLine(item);
            }
            Console.WriteLine();

            //––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

            Fan   fanOne = new Fan();
            Fan   fanTwo = new Fan();
            Match match  = new Match();

            match.GoalEvent += (Fan one, Fan two) =>
            {
                one.Goal();
                two.Goal();
            };

            match.Goal(fanOne, fanTwo);
        }
Exemplo n.º 2
0
 public void Goal(Fan fanOne, Fan fanTwo)
 {
     Console.WriteLine("Был забит гол. Что скажут фанаты?!");
     GoalEvent(fanOne, fanTwo);
 }