async Task ExecuteAsync() { try { IListDebugPropertyInfo propertiesList = await _taskExecutor.SubmitAsync(GetPropertiesInfoAsync, _cancelSource.Token, nameof(ExecuteAsync), typeof(AsyncGetPropertiesOperation)); uint total = (uint)await _childrenProvider.GetChildrenCountAsync(); _completionHandler.OnComplete(VSConstants.S_OK, total, propertiesList); } catch (OperationCanceledException) { // OnComplete has already been sent from Cancel() } catch (Exception e) { Trace.WriteLine($"Error processing async get properties request: {e}"); _completionHandler.OnComplete(e.HResult, 0, null); } finally { _cancelSource.Dispose(); _cancelSource = null; } }
async Task ExecuteAsync() { try { IListDebugPropertyInfo propertiesList = await _taskExecutor.SubmitAsync(GetPropertiesInfoAsync, _cancelSource.Token, nameof(ExecuteAsync), typeof(AsyncGetRootPropertiesOperation)); int status = propertiesList != null ? VSConstants.S_OK : VSConstants.E_FAIL; _completionHandler.OnComplete(status, (uint)(propertiesList?.Count ?? 0), propertiesList); } catch (OperationCanceledException) { // OnComplete has already been sent from Cancel() } catch (Exception e) { Trace.WriteLine($"Error processing async get root properties request: {e}"); _completionHandler.OnComplete(e.HResult, 0, null); } finally { _cancelSource.Dispose(); _cancelSource = null; } }