【发布时间】:2011-11-25 00:01:16
【问题描述】:
我正在将工作代码从 .NET4 移植到 .NET2(WinCE 设备)。
.NET2中不允许使用不带参数不返回值的Action
下面第 5 行的编译错误:使用泛型类型 'System.Action' 需要 '1' 类型参数
解决方法的想法?
//first state is the default for the system
public enum States { EnterVoucherCode, EnterTotalSale, ProcessVoucher };
public enum Events { PressNext, PressRedeem, ProcessSuccess, ProcessFail, PressBackToVoucherCode };
public States State { get; set; }
private Action[,] fsm; //Fails to compile here
public FiniteStateMachine()
{
//array of action delegates
fsm = new Action[3, 5] {
//PressNext, PressRedeem, ProcessSuccess, ProcessFail, PressBackToVoucherCode
【问题讨论】: