public static void p01(WgContext Context, S03 Data) { // data Data.Result = new List <string> (); // stacking sub-blocks Context.ProceedTo <S03> (p02); Context.ProceedTo(S03._foreach01.Generate(ForEach_01_GetContainer, ForEach_01_Step, ForEach_01_Body)); }
static void Main(string[] args) { WgContext Context; DelegateConverter DelConv = new DelegateConverter(); // string StateFilePath = Path.GetFullPath("state.json"); Encoding enc = Encoding.UTF8; if (File.Exists(StateFilePath)) { string StateJson = File.ReadAllText(StateFilePath, enc); Context = JsonConvert.DeserializeObject <WgContext> (StateJson, DelConv); } else { Context = new WgContext(); //S01 Data = new S01 { Numbers = new[] { 5, 3, 8, 10, 1, 7, 4, 2 } }; //Context.ProceedTo (Pieces01.p01, Data); //S02 Data = new S02 { Top = DateTime.Now.Second }; //Context.ProceedTo (Pieces02.p01, Data); S03 Data = new S03 { Lines = new List <string> { "report", "story", "lines", "text", "narrative", "plot" } }; Context.ProceedTo(Pieces03.p01, Data); } Context.Run(new ManualResetEvent(false)); { string StateJson = JsonConvert.SerializeObject(Context, DelConv); File.WriteAllText(StateFilePath, StateJson, enc); } }
public static void p02(WgContext Context, S03 Data) { System.IO.File.WriteAllLines("out.txt", Data.Result); }