public UIThreadOnly(InteractiveWindow window, IInteractiveWindowEditorFactoryService host)
 {
     _window = window;
     _host   = host;
     StandardInputProtection      = new IReadOnlyRegion[2];
     _outputProtection            = new IReadOnlyRegion[2];
     _pendingSubmissions          = new Queue <PendingSubmission>();
     _outputTrackingCaretPosition = -1;
 }
예제 #2
0
 public UIThreadOnly(InteractiveWindow window, IInteractiveWindowEditorFactoryService host)
 {
     _window                      = window;
     _host                        = host;
     _uiScheduler                 = TaskScheduler.FromCurrentSynchronizationContext();
     StandardInputProtection      = new IReadOnlyRegion[2];
     _outputProtection            = new IReadOnlyRegion[2];
     _pendingSubmissions          = new Queue <PendingSubmission>();
     _outputTrackingCaretPosition = -1;
 }
예제 #3
0
        public OutputBuffer(InteractiveWindow window)
        {
            Reset();

            this.mutex = new object();
            this.window = window;

            this.timer = new DispatcherTimer();
            this.timer.Tick += (sender, args) => Flush();
            this.timer.Interval = TimeSpan.FromMilliseconds(AutoFlushMilliseconds);
        }
        public ISmartIndent CreateSmartIndent(ITextView view)
        {
            var window = InteractiveWindow.FromBuffer(view.TextBuffer);

            if (window == null || window.CurrentLanguageBuffer == null)
            {
                return(null);
            }

            return(InteractiveSmartIndenter.Create(this.indentProviders, window.CurrentLanguageBuffer.ContentType, view));
        }
예제 #5
0
        public OutputBuffer(InteractiveWindow window)
        {
            Reset();

            _mutex  = new object();
            _window = window;

            _timer          = new DispatcherTimer();
            _timer.Tick    += (sender, args) => Flush();
            _timer.Interval = TimeSpan.FromMilliseconds(AutoFlushMilliseconds);
        }
 public UIThreadOnly(InteractiveWindow window, IInteractiveWindowEditorFactoryService host)
 {
     _window = window;
     _host = host;
     _uiScheduler = TaskScheduler.FromCurrentSynchronizationContext();
     StandardInputProtection = new IReadOnlyRegion[2];
     _outputProtection = new IReadOnlyRegion[2];
     _pendingSubmissions = new Queue<PendingSubmission>();
     _outputTrackingCaretPosition = -1;
 }
            public UIThreadOnly(
                InteractiveWindow window,
                IInteractiveWindowEditorFactoryService factory,
                IContentTypeRegistryService contentTypeRegistry,
                ITextBufferFactoryService bufferFactory,
                IProjectionBufferFactoryService projectionBufferFactory,
                IEditorOperationsFactoryService editorOperationsFactory,
                ITextEditorFactoryService editorFactory,
                IRtfBuilderService rtfBuilderService,
                IIntellisenseSessionStackMapService intellisenseSessionStackMap,
                ISmartIndentationService smartIndenterService,
                IInteractiveEvaluator evaluator,
                IWaitIndicator waitIndicator)
            {
                _window = window;
                _factory = factory;
                _rtfBuilderService = (IRtfBuilderService2)rtfBuilderService;
                _intellisenseSessionStackMap = intellisenseSessionStackMap;
                _smartIndenterService = smartIndenterService;
                _waitIndicator = waitIndicator;
                Evaluator = evaluator;

                var replContentType = contentTypeRegistry.GetContentType(PredefinedInteractiveContentTypes.InteractiveContentTypeName);
                var replOutputContentType = contentTypeRegistry.GetContentType(PredefinedInteractiveContentTypes.InteractiveOutputContentTypeName);

                OutputBuffer = bufferFactory.CreateTextBuffer(replOutputContentType);
                StandardInputBuffer = bufferFactory.CreateTextBuffer();
                _inertType = bufferFactory.InertContentType;

                _projectionBuffer = projectionBufferFactory.CreateProjectionBuffer(
                    new EditResolver(window),
                    Array.Empty<object>(),
                    ProjectionBufferOptions.None,
                    replContentType);

                _projectionBuffer.Properties.AddProperty(typeof(InteractiveWindow), window);

                AppendNewOutputProjectionBuffer();
                _projectionBuffer.Changed += new EventHandler<TextContentChangedEventArgs>(ProjectionBufferChanged);

                var roleSet = editorFactory.CreateTextViewRoleSet(
                    PredefinedTextViewRoles.Analyzable,
                    PredefinedTextViewRoles.Editable,
                    PredefinedTextViewRoles.Interactive,
                    PredefinedTextViewRoles.Zoomable,
                    PredefinedInteractiveTextViewRoles.InteractiveTextViewRole);

                TextView = factory.CreateTextView(window, _projectionBuffer, roleSet);
                TextView.Caret.PositionChanged += CaretPositionChanged;

                var options = TextView.Options;
                options.SetOptionValue(DefaultTextViewHostOptions.HorizontalScrollBarId, true);
                options.SetOptionValue(DefaultTextViewHostOptions.LineNumberMarginId, false);
                options.SetOptionValue(DefaultTextViewHostOptions.OutliningMarginId, false);
                options.SetOptionValue(DefaultTextViewHostOptions.GlyphMarginId, false);
                options.SetOptionValue(DefaultTextViewOptions.WordWrapStyleId, WordWrapStyles.None);

                _lineBreakString = options.GetNewLineCharacter();
                EditorOperations = editorOperationsFactory.GetEditorOperations(TextView);

                _buffer = new OutputBuffer(window);
                OutputWriter = new InteractiveWindowWriter(window, spans: null);

                SortedSpans errorSpans = new SortedSpans();
                ErrorOutputWriter = new InteractiveWindowWriter(window, errorSpans);
                OutputClassifierProvider.AttachToBuffer(OutputBuffer, errorSpans);
            }
 public UIThreadOnly(InteractiveWindow window, IInteractiveWindowEditorFactoryService factory, IRtfBuilderService rtfBuilderService)
 {
     _window = window;
     _factory = factory;
     _rtfBuilderService = rtfBuilderService;
 }
 public UIThreadOnly(InteractiveWindow window, IInteractiveWindowEditorFactoryService host)
 {
     _window = window;
     _host = host;
     StandardInputProtection = new IReadOnlyRegion[2];
     _outputProtection = new IReadOnlyRegion[2];
     _pendingSubmissions = new Queue<PendingSubmission>();
     _outputTrackingCaretPosition = -1;
 }
 public EditResolver(InteractiveWindow window)
 {
     _window = window;
 }
 /// <summary>
 /// Gets the interactive window associated with the text buffer if the text
 /// buffer is being hosted in the interactive window.
 ///
 /// Returns null if the text buffer is not hosted in the interactive window.
 /// </summary>
 public static IInteractiveWindow GetInteractiveWindow(this ITextBuffer buffer)
 {
     return(InteractiveWindow.FromBuffer(buffer));
 }
 public EditResolver(InteractiveWindow window)
 {
     _window = window;
 }