标签:blog [] 委托 style using cti system ogr cad
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace 委托 { class Program { static void Main(string[] args) { #region 不带返回值的泛型委托 //Action<int, int> AddAction = new Action<int, int>(StaticAddFunction); //if(AddAction!=null) //{ // AddAction(3, 4); //} #endregion #region 带返回值的泛型委托 Func<int, int, int> AddFunc = new Func<int, int, int>(StaticAddFunction); if (AddFunc != null) { int nResult = AddFunc(3, 4); Console.WriteLine(nResult.ToString()); } #endregion Console.ReadKey(); } //static void StaticAddFunction(int a,int b) //{ // Console.WriteLine("static:" + (a + b).ToString()); //} static int StaticAddFunction(int a, int b) { return a + b; } } }
标签:blog [] 委托 style using cti system ogr cad
原文地址:http://www.cnblogs.com/caohuimingfa/p/6443586.html