Ejemplo n.º 1
0
        private void CreateTipView()
        {
            var roles = this.provider.EditorFactory.CreateTextViewRoleSet(ViewRoles.ToolTipView);
            var model = new TipTextViewModel(this.sourceTextView);

            var options = this.provider.OptionsFactory.GlobalOptions;

            this.tipView = this.provider.EditorFactory.CreateTextView(model, roles, options);
            options      = this.tipView.Options;
            options.SetOptionValue(DefaultTextViewOptions.IsViewportLeftClippedId, true);
            options.SetOptionValue(ViewOptions.WordWrapStyleId, WordWrapStyles.None);
            options.SetOptionValue(ViewOptions.ViewProhibitUserInput, true);

            // only for VS2017 15.6 and up, where IIntellisensePresenter is
            // not supported anymore (replaced by the tooltip APIs), we
            // set the background to transparent so that it looks like regular
            // intellisense popup
            if (this.provider.VsFeatures.IsSupported(KnownFeatures.TooltipApi))
            {
                this.tipView.Background = Brushes.Transparent;
            }
            this.tipView.ViewportWidthChanged += OnViewportWidthChanged;

            this.tipView.ZoomLevel = GetSourceZoomFactor() * ZoomFactor * 100;
            this.wrapper           = new Border()
            {
                Child = this.tipView.VisualElement
            };

            this.tipView.Set(new ViewTipProperty());
        }
Ejemplo n.º 2
0
        private void CreateTipView()
        {
            var roles = this.provider.EditorFactory.CreateTextViewRoleSet(ViewRoles.ToolTipView);
            var model = new TipTextViewModel(this.sourceTextView);

            var options = this.provider.OptionsFactory.CreateOptions();

            options.SetOptionValue(DefaultTextViewOptions.IsViewportLeftClippedId, true);
            options.SetOptionValue(Constants.WordWrapStyleId, WordWrapStyles.None);

            this.tipView = this.provider.EditorFactory.CreateTextView(model, roles, options);
            this.tipView.ViewportWidthChanged += OnViewportWidthChanged;

            IWpfTextView wpfSource = this.sourceTextView as IWpfTextView;

            if (wpfSource != null)
            {
                this.tipView.ZoomLevel = wpfSource.ZoomLevel;
            }
            else
            {
                this.tipView.ZoomLevel = 100;
            }
            this.wrapper       = new Border();
            this.wrapper.Child = this.tipView.VisualElement;
        }
Ejemplo n.º 3
0
        private void CreateTipView()
        {
            var roles = this.provider.EditorFactory.CreateTextViewRoleSet(ViewRoles.ToolTipView);
              var model = new TipTextViewModel(this.sourceTextView);

              var options = this.provider.OptionsFactory.GlobalOptions;
              this.tipView = this.provider.EditorFactory.CreateTextView(model, roles, options);
              options = this.tipView.Options;
              options.SetOptionValue(DefaultTextViewOptions.IsViewportLeftClippedId, true);
              options.SetOptionValue(ViewOptions.WordWrapStyleId, WordWrapStyles.None);
              options.SetOptionValue(ViewOptions.ViewProhibitUserInput, true);

              this.tipView.ViewportWidthChanged += OnViewportWidthChanged;

              this.tipView.ZoomLevel = GetSourceZoomFactor() * ZoomFactor * 100;
              this.wrapper = new Border();
              this.wrapper.Child = this.tipView.VisualElement;
        }
Ejemplo n.º 4
0
        private void CreateTipView()
        {
            var roles = this.provider.EditorFactory.CreateTextViewRoleSet(ViewRoles.ToolTipView);
            var model = new TipTextViewModel(this.sourceTextView);

            var options = this.provider.OptionsFactory.GlobalOptions;

            this.tipView = this.provider.EditorFactory.CreateTextView(model, roles, options);
            options      = this.tipView.Options;
            options.SetOptionValue(DefaultTextViewOptions.IsViewportLeftClippedId, true);
            options.SetOptionValue(ViewOptions.WordWrapStyleId, WordWrapStyles.None);
            options.SetOptionValue(ViewOptions.ViewProhibitUserInput, true);

            this.tipView.ViewportWidthChanged += OnViewportWidthChanged;

            this.tipView.ZoomLevel = GetSourceZoomFactor() * ZoomFactor * 100;
            this.wrapper           = new Border();
            this.wrapper.Child     = this.tipView.VisualElement;
        }