文件名称:无状态:使用C#代码创建状态机的简单库
文件大小:117KB
文件格式:ZIP
更新时间:2024-03-04 08:19:00
C#
无状态 直接在.NET代码中创建状态机和基于轻量级状态机的工作流: var phoneCall = new StateMachine < State>( State . OffHook ); phoneCall . Configure ( State . OffHook ) . Permit ( Trigger . CallDialled , State . Ringing ); phoneCall . Configure ( State . Connected ) . OnEntry ( t => StartCallTimer ()) . OnExit ( t => StopCallTimer ()) . InternalTransition ( Trigger . MuteMicrophone , t => OnMute ())