src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Editor/ProjectFileEditorPresenter.cs
/// <summary>
/// Updates the content of the project file to be the latest msbuild text.
/// </summary>
/// <returns></returns>
Updates the content of the project file to be the latest msbuild text.
Updates the content of the project file to be the latest msbuild text .
private async Task UpdateProjectFileAsync()
        {
            await _threadingService.SwitchToUIThread();
            lock (_lock)
            {
                if (_currentState != EditorState.BufferUpdateScheduled)
                {
                    return;
                }
            }
            await _textBufferManager.SetReadOnlyAsync(true).ConfigureAwait(true);
            await _textBufferManager.ResetBufferAsync().ConfigureAwait(true);
            lock (_lock)
            {
                _currentState = EditorState.EditorOpen;
            }
            await _textBufferManager.SetReadOnlyAsync(false).ConfigureAwait(true);
        }
private async Task UpdateProjectFileAsync ( ) { await _threadingService . SwitchToUIThread ( ) ; lock ( _lock ) { if ( _currentState != EditorState . BufferUpdateScheduled ) { return ; } } await _textBufferManager . SetReadOnlyAsync ( true ) . ConfigureAwait ( true ) ; await _textBufferManager . ResetBufferAsync ( ) . ConfigureAwait ( true ) ; lock ( _lock ) { _currentState = EditorState . EditorOpen ; } await _textBufferManager . SetReadOnlyAsync ( false ) . ConfigureAwait ( true ) ; }
Updates the content of the project file to be the latest msbuild text.
Updates the content of the project file to be the latest msbuild text .
// We do this on the UI thread to ensure that between setting the state to a variant of ProjectFileChanging and setting the window // frame to readonly, the user can't do any input (and potentially cause a conflict). // Only update the project file if we have scheduled an update. Any other state is either already updating the buffer, // or in the processes of closing the buffer. // Set set the buffer to be unmodifiable to prevent any changes while we update the project // Set the buffer to default state and set the current state to editor clean
None