src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Editor/ProjectFileEditorPresenter.cs
/// <summary>
/// Starts the process of closing the project file editor, if one is open currently.
/// </summary>
Starts the process of closing the project file editor, if one is open currently.
Starts the process of closing the project file editor if one is open currently .
public async Task CloseCurrentEditorAsync()
        {
            lock (_lock)
            {
                if (_currentState == EditorState.NoEditor)
                {
                    return;
                }
                _currentState = EditorState.EditorClosing;
            }
            _projectFileModelWatcher?.Dispose();
            _textBufferStateListener?.Dispose();
            if (_frameEventsListener != null)
            {
                await _frameEventsListener.DisposeAsync().ConfigureAwait(false);
            }
            _textBufferManager?.Dispose();
            _projectFileModelWatcher = null;
            _frameEventsListener = null;
            _textBufferStateListener = null;
            _textBufferManager = null;
            lock (_lock)
            {
                _currentState = EditorState.NoEditor;
            }
            return;
        }
public async Task CloseCurrentEditorAsync ( ) { lock ( _lock ) { if ( _currentState == EditorState . NoEditor ) { return ; } _currentState = EditorState . EditorClosing ; } _projectFileModelWatcher ? . Dispose ( ) ; _textBufferStateListener ? . Dispose ( ) ; if ( _frameEventsListener != null ) { await _frameEventsListener . DisposeAsync ( ) . ConfigureAwait ( false ) ; } _textBufferManager ? . Dispose ( ) ; _projectFileModelWatcher = null ; _frameEventsListener = null ; _textBufferStateListener = null ; _textBufferManager = null ; lock ( _lock ) { _currentState = EditorState . NoEditor ; } return ; }
Starts the process of closing the project file editor, if one is open currently.
Starts the process of closing the project file editor if one is open currently .
// Checking for potential dirty state and asking if the user wants to save their changes will have already occurred at this point. // Just go to EditorClosing.