class ClassWithDelegate { public delegate int DelegateThatReturnsInt(); public DelegateThatReturnsInt theDelegate; public void Run() { for (; ; ) { Thread.Sleep(500); if (theDelegate != null) {//第一... Read More
posted @ 2010-10-21 21:11 gull Views(234) Comments(0) Diggs(0) Edit
这是一个委托排序的例子public enum Comparsion { theFirstComesFirst=1, theSecondComesFirst=2 } //来决定排序的顺序class Pair<T> //在下面我创建的两个类Student,Dog,都把他们保存在Pair里面{ private T[] thePair = new T[2]; public delegate... Read More
posted @ 2010-10-21 09:28 gull Views(249) Comments(0) Diggs(0) Edit