示例#1
0
        static void Main(string[] args)
        {
            GenericList <int> list = new GenericList <int>();
            int          sum       = 0;
            int          max       = -99999999;
            int          min       = 99999999;
            Action <int> Action1   = m => Console.WriteLine(m);
            Action <int> Action2   = m => sum += m;
            Action <int> Action3   = m => { if (m > max)
                                            {
                                                max = m;
                                            }
            };
            Action <int> Action4 = m => { if (m < min)
                                          {
                                              min = m;
                                          }
            };

            list.ForEach(Action1);
            list.ForEach(Action2);
            list.ForEach(Action3);
            list.ForEach(Action4);
        }