示例#1
0
        public async Task CommitUpdatesAsync(CancellationToken cancellationToken)
        {
            if (_disabled)
            {
                return;
            }

            try
            {
                var committedSolution = Interlocked.Exchange(ref _pendingUpdatedSolution, null);
                Contract.ThrowIfNull(committedSolution);
                SolutionCommitted?.Invoke(committedSolution);
            }
            catch (Exception e) when(FatalError.ReportAndCatch(e))
            {
            }

            try
            {
                await GetDebuggingSession().CommitSolutionUpdateAsync(_diagnosticService, cancellationToken).ConfigureAwait(false);
            }
            catch (Exception e) when(FatalError.ReportAndCatch(e))
            {
            }
        }
        public async ValueTask CommitUpdatesAsync(CancellationToken cancellationToken)
        {
            try
            {
                var committedDesignTimeSolution = Interlocked.Exchange(ref _pendingUpdatedDesignTimeSolution, null);
                Contract.ThrowIfNull(committedDesignTimeSolution);
                SolutionCommitted?.Invoke(committedDesignTimeSolution);

                _committedDesignTimeSolution = committedDesignTimeSolution;
            }
            catch (Exception e) when(FatalError.ReportAndCatch(e))
            {
            }

            try
            {
                Contract.ThrowIfTrue(_disabled);
                await GetDebuggingSession().CommitSolutionUpdateAsync(_diagnosticService, cancellationToken).ConfigureAwait(false);
            }
            catch (Exception e) when(FatalError.ReportAndCatchUnlessCanceled(e, cancellationToken))
            {
            }
        }
 private void OnEditAndContinueSolutionCommitted(Solution solution)
 {
     SolutionCommitted?.Invoke(solution);
 }