src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Editor/ProjectFileEditorPresenter.cs
/// <summary>
/// Tells the editor to call close on the existing window frame.
/// </summary>
/// <returns>True if the close was successful, false if the window is still open</returns>
Tells the editor to call close on the existing window frame.
Tells the editor to call close on the existing window frame .
public async Task<bool> CanCloseWindowAsync()
        {
            lock (_lock)
            {
                Assumes.False(_currentState == EditorState.NoEditor ||
                    _currentState == EditorState.Initializing ||
                    _currentState == EditorState.EditorClosing);
            }
            await _threadingService.SwitchToUIThread();
            return _windowFrame.CloseFrame((uint)__FRAMECLOSE.FRAMECLOSE_PromptSave) == VSConstants.S_OK;
        }
public async Task < bool > CanCloseWindowAsync ( ) { lock ( _lock ) { Assumes . False ( _currentState == EditorState . NoEditor || _currentState == EditorState . Initializing || _currentState == EditorState . EditorClosing ) ; } await _threadingService . SwitchToUIThread ( ) ; return _windowFrame . CloseFrame ( ( uint ) __FRAMECLOSE . FRAMECLOSE_PromptSave ) == VSConstants . S_OK ; }
Tells the editor to call close on the existing window frame.
Tells the editor to call close on the existing window frame .
// We can't switch to editor closing here because there's still the chance that some other action can cancel // the editor closing, without notifying us. A later callback will get hit once the close is guaranteed to happen. // We do, however, assert that we're not in NoEditor, Initializing, or EditorClosing; being in any of those states // here would indicate a bug.
True if the close was successful, false if the window is still open
True if the close was successful false if the window is still open