コード例 #1
0
 public int OnAfterDocumentWindowHide(uint docCookie, IVsWindowFrame pFrame)
 {
     if (IsVisible && _activeWpfTextView != null && pFrame.GetWpfTextView() == _activeWpfTextView)
     {
         Clear();
     }
     return(VSConstants.S_OK);
 }
コード例 #2
0
 int IVsRunningDocTableEvents.OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame)
 {
     if (IsVisible && fFirstShow == 0)
     {
         var wpfTextView = pFrame.GetWpfTextView();
         if (wpfTextView != null)
         {
             var contentType = wpfTextView.TextBuffer.ContentType;
             if (contentType.IsOfType(HlslConstants.ContentTypeName))
             {
                 Clear();
                 _activeWpfTextView = wpfTextView;
                 _activeWpfTextView.Selection.SelectionChanged += HandleSelectionChanged;
                 _activeWpfTextView.TextBuffer.Changed         += HandleTextBufferChanged;
                 _activeWpfTextView.LostAggregateFocus         += HandleTextViewLostFocus;
                 RefreshSyntaxVisualizer();
             }
         }
     }
     return(VSConstants.S_OK);
 }
コード例 #3
0
 int IVsRunningDocTableEvents.OnBeforeDocumentWindowShow(uint docCookie, int fFirstShow, IVsWindowFrame pFrame)
 {
     if (IsVisible && fFirstShow == 0)
     {
         var wpfTextView = pFrame.GetWpfTextView();
         if (wpfTextView != null)
         {
             var contentType = wpfTextView.TextBuffer.ContentType;
             if (contentType.IsOfType(HlslConstants.ContentTypeName))
             {
                 Clear();
                 _activeWpfTextView = wpfTextView;
                 _activeWpfTextView.Selection.SelectionChanged += HandleSelectionChanged;
                 _activeWpfTextView.TextBuffer.Changed += HandleTextBufferChanged;
                 _activeWpfTextView.LostAggregateFocus += HandleTextViewLostFocus;
                 RefreshSyntaxVisualizer();
             }
         }
     }
     return VSConstants.S_OK;
 }
コード例 #4
0
 public int OnAfterDocumentWindowHide(uint docCookie, IVsWindowFrame pFrame)
 {
     if (IsVisible && _activeWpfTextView != null && pFrame.GetWpfTextView() == _activeWpfTextView)
         Clear();
     return VSConstants.S_OK;
 }