private void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var nowVisible = (bool)e.NewValue;

            if (nowVisible)
            {
                EnsureContentCreated();
            }
            else
            {
                this.Content = null;

                _createdView.Close();
                _createdView = null;

                // If a projection buffer has a source span from another buffer, the projection buffer is held alive by the other buffer too.
                // This means that a one-off projection buffer created for a tooltip would be kept alive as long as the underlying file
                // is still open. Removing the source spans from the projection buffer ensures the projection buffer can be GC'ed.
                if (_createdTextBuffer is IProjectionBuffer projectionBuffer)
                {
                    projectionBuffer.DeleteSpans(0, projectionBuffer.CurrentSnapshot.SpanCount);
                }

                _createdTextBuffer = null;
            }
        }
示例#2
0
 internal void CloseTextView()
 {
     if (_textView != null && !_textView.IsClosed)
     {
         _textView.Close();
         _textView = null;
     }
 }
示例#3
0
 public void Dispose()
 {
     if (wpfTextView.IsClosed)
     {
         return;
     }
     uiControl.Dispose();
     wpfTextView.Properties.RemoveProperty(typeof(EditValueImpl));
     wpfTextView.VisualElement.Loaded -= VisualElement_Loaded;
     wpfTextView.LostAggregateFocus   -= WpfTextView_LostAggregateFocus;
     wpfTextView.Close();
 }
        void IInteractiveWindow.Close()
        {
            Caret.PositionChanged -= CaretPositionChanged;

            UIThread(uiOnly => _textView.Close());
        }
 public void CloseInInsertMode()
 {
     Create("foo", "bar");
     _buffer.SwitchMode(ModeKind.Insert, ModeArgument.None);
     _textView.Close();
 }
示例#6
0
 public void CloseInInsertMode()
 {
     Create("foo", "bar");
     _textView.Close();
 }