Пример #1
0
        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();
 }
Пример #4
0
        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();
 }