I find this quite useful and it probably does make developing code faster in some circumstances. Thanks Jeff
IEnumerator<ITask> CcrReadFileAsync(string file){ var result = new Port<IAsyncResult>(); using (var fs = new FileStream(file,…,FileOptions.Asynchronous)) {
var buf = new byte[fs.Length]; fs.BeginRead(buf, 0, buf.Length, result.Post, null); yield return result.Receive(); var ar = (IAsyncResult)resultPort.Test(); try { fs.EndRead(ar); ProcessData(buf); } catch { // handle exception } } }
Thank you my dear friend. I like you and your books.............