private async Task <IEnumerable <BuildResult> > ProcessRecordAsync(PSEventSink eventSink) { try { return(await MarshalTask.FromAsync( _msBuildHelper.BeginProcessRecord, _msBuildHelper.EndProcessRecord)); } finally { eventSink.CompleteWriting(); } }
public IEnumerable<BuildResult> EndProcessRecord(IAsyncResult asyncResult) { return MarshalTask.GetResult<IEnumerable<BuildResult>>(asyncResult); }
public IAsyncResult BeginProcessRecord(AsyncCallback callback, object state) { return MarshalTask.FromTask(ProcessRecordAsync(), callback, state); }