int IVsCodeWindowEvents.OnCloseView(IVsTextView vsTextView) { _viewCount--; if (_viewCount == 0) { _pyService.CodeWindowClosed(_window); } _pyService.OnIdle -= OnIdle; if (TryGetTextView(vsTextView, out var wpfTextView)) { wpfTextView.GotAggregateFocus -= OnTextViewGotAggregateFocus; wpfTextView.LostAggregateFocus -= OnTextViewLostAggregateFocus; } return(VSConstants.S_OK); }
int IVsCodeWindowEvents.OnCloseView(IVsTextView vsTextView) { _viewCount--; if (_viewCount == 0) { _pyService.CodeWindowClosed(_window); } _pyService.OnIdle -= OnIdle; var wpfTextView = VsEditorAdaptersFactoryService.GetWpfTextView(vsTextView); if (wpfTextView != null) { wpfTextView.GotAggregateFocus -= OnTextViewGotAggregateFocus; wpfTextView.LostAggregateFocus -= OnTextViewLostAggregateFocus; } return(VSConstants.S_OK); }