File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,6 +159,7 @@ private void AppendToWindowTitle(string title)
159159
160160 public void VsTextViewCreated ( IVsTextView textView )
161161 {
162+ ThreadHelper . ThrowIfNotOnUIThread ( ) ;
162163 Initialize ( ) ;
163164
164165 IWpfTextView wpfTextView = editor . GetWpfTextView ( textView ) ;
@@ -170,14 +171,17 @@ public void VsTextViewCreated(IVsTextView textView)
170171 }
171172 private void WpfTextView_GotAggregateFocus ( object sender , EventArgs e )
172173 {
174+ ThreadHelper . ThrowIfNotOnUIThread ( ) ;
173175 Update ( GetFilePath ( ( ITextView ) sender ) ) ;
174176 }
175177 private void WpfTextView_LayoutChanged ( object sender , TextViewLayoutChangedEventArgs e )
176178 {
179+ ThreadHelper . ThrowIfNotOnUIThread ( ) ;
177180 Update ( GetFilePath ( ( ITextView ) sender ) ) ;
178181 }
179182 private void Caret_PositionChanged ( object sender , CaretPositionChangedEventArgs e )
180183 {
184+ ThreadHelper . ThrowIfNotOnUIThread ( ) ;
181185 Update ( GetFilePath ( e . TextView ) ) ;
182186 }
183187 private void DocumentEvents_DocumentSaved ( Document Document )
@@ -233,6 +237,8 @@ private void Initialize()
233237 }
234238 private void Update ( string path , bool force = false )
235239 {
240+ ThreadHelper . ThrowIfNotOnUIThread ( ) ;
241+
236242 var time = DateTime . Now ;
237243 if ( force ||
238244 time - lastUpdate >= updateInterval ||
You can’t perform that action at this time.
0 commit comments