Example #1
0
 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);
 }
Example #2
0
        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);
        }