我正在将工作代码从.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
Run Code Online (Sandbox Code Playgroud)