private void InvokeControl() { FlowStatus fs = FlowStatus.Continue; IFlowControl ctrl = (obj as IFlowControl); while (ctrl.CheckDo() == FlowStatus.Continue) { InvokeSubActions(); if (!ctrl.IsIterate) { break; } } }
private async Task <INetworkCommand> Receive() { if (ReceiveString == null) { ReceiveString = new ReceiveString( new ReceiveBytes(() => Task.FromResult(Socket)) ); } string json = await ReceiveString.AwaitFlowResult(); using (JsonReader jr = new JsonTextReader(new StringReader(json))) { return(Serializer.Deserialize <INetworkCommand>(jr)); } }
public static async Task <T> AwaitFlowResult <T>(this IFlowControl <T> control) { await control.AwaitFlowControl(); return(control.Result); }