c#多播委托

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    public delegate void del();
    class Program
    {
        static void Main(string[] args)
        {
            del a = msg1;
            a += msg2;
            a += msg3;
            a -= msg4;
            a();
            Console.ReadKey();
        }
        public static void msg1() 
        {
            Console.WriteLine("你好");
        }
        public static void msg2()
        {
            Console.WriteLine("你好");
        }
        public static void msg3()
        {
            Console.WriteLine("你好");
        }
        public static void msg4()
        {
            Console.WriteLine("你好");
        }
    }
}

  

posted @ 2016-05-24 11:20  尘梦  阅读(529)  评论(0编辑  收藏  举报