C#_delegate - combine function

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace Delegate
{
public delegate void Myfunction(); class Program
{ static void Main(string[] args)
{ Myfunction mf = MethodA;
mf += MethodB;
mf(); Console.ReadLine(); } public static void MethodA() {
Console.WriteLine("A doing");
}
public static void MethodB()
{
Console.WriteLine("B doing");
}
public static void MethodC()
{
Console.WriteLine("C doing");
}
}
}
上一篇:php最新版本配置mysqli


下一篇:Linux创建用户(转)