当前位置: 首页>>代码示例>>C#>>正文


C# IWpfTextViewMargin.GetTextViewMargin方法代码示例

本文整理汇总了C#中IWpfTextViewMargin.GetTextViewMargin方法的典型用法代码示例。如果您正苦于以下问题:C# IWpfTextViewMargin.GetTextViewMargin方法的具体用法?C# IWpfTextViewMargin.GetTextViewMargin怎么用?C# IWpfTextViewMargin.GetTextViewMargin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IWpfTextViewMargin的用法示例。


在下文中一共展示了IWpfTextViewMargin.GetTextViewMargin方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SimpleScrollBar

        public SimpleScrollBar(IWpfTextViewHost host, IWpfTextViewMargin containerMargin, FrameworkElement container,
            IScrollMapFactoryService scrollMapFactoryService)
        {
            _textView = host.TextView;

            _realScrollBarMargin =
                containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;
            if (_realScrollBarMargin != null)
            {
                _realScrollBar = _realScrollBarMargin as IVerticalScrollBar;
                if (_realScrollBar != null)
                {
                    _realScrollBarMargin.VisualElement.IsVisibleChanged += OnScrollBarIsVisibleChanged;
                    _realScrollBar.TrackSpanChanged += OnScrollBarTrackSpanChanged;
                }
            }
            ResetTrackSpan();

            _scrollMapFactory = scrollMapFactoryService;
            _useElidedCoordinates = false;
            ResetScrollMap();

            _scrollMap.MappingChanged += delegate { RaiseTrackChangedEvent(); };

            container.SizeChanged += OnContainerSizeChanged;
        }
开发者ID:mpartipilo,项目名称:SonarCompanion,代码行数:26,代码来源:SimpleScrollBar.cs

示例2: ScrollDiffMargin

        internal ScrollDiffMargin(IWpfTextView textView, UnifiedDiff unifiedDiff, IMarginCore marginCore, IWpfTextViewMargin containerMargin)
            : base(textView)
        {
            var scrollBarMargin = containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar);
            // ReSharper disable once SuspiciousTypeConversion.Global
            _scrollBar = (IVerticalScrollBar)scrollBarMargin;

            ViewModel = new ScrollDiffMarginViewModel(marginCore, unifiedDiff, UpdateDiffDimensions);

            UserControl = new ScrollDiffMarginControl { DataContext = ViewModel, Width = MarginWidth, MaxWidth = MarginWidth, MinWidth = MarginWidth};
        }
开发者ID:laurentkempe,项目名称:PReview,代码行数:11,代码来源:ScrollDiffMargin.cs

示例3: CreateMargin

        /// <summary>
        /// Creates an <see cref="IWpfTextViewMargin"/> for the given <see cref="IWpfTextViewHost"/>.
        /// </summary>
        /// <param name="wpfTextViewHost">The <see cref="IWpfTextViewHost"/> for which to create the <see cref="IWpfTextViewMargin"/>.</param>
        /// <param name="marginContainer">The margin that will contain the newly-created margin.</param>
        /// <returns>The <see cref="IWpfTextViewMargin"/>.
        /// The value may be null if this <see cref="IWpfTextViewMarginProvider"/> does not participate for this context.
        /// </returns>
        #endregion
        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer) {

            var scrollBar = marginContainer.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IVerticalScrollBar;
            if (scrollBar == null) {
                return null;
            }

            return new DiagnosticStripeMargin(
                wpfTextViewHost.TextView,                  
                scrollBar, 
                _editorFormatMapService);
        }
开发者ID:csharper2010,项目名称:Nav.Language.Extensions,代码行数:21,代码来源:DiagnosticStripeMarginProvider.cs

示例4: CreateMargin

		public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
		{
			if (textViewHost.TextView.Roles.ContainsAny(RejectedRoles))
			{
				return null;
			}

			DTE dte = (DTE) ServiceProvider.GetService(typeof (DTE));

			// Hide the real scroll bar
			IWpfTextViewMargin realScrollBar =
				containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;
			if (realScrollBar != null)
			{
				realScrollBar.VisualElement.MinWidth = 0.0;
				realScrollBar.VisualElement.Width = 0.0;
			}

			IWpfTextView textView = textViewHost.TextView;

			SimpleScrollBar scrollBar = new SimpleScrollBar(
				textView,
				containerMargin,
				_scrollMapFactory);

			ProgressiveScroll progressiveScroll = new ProgressiveScroll(
				containerMargin,
				textView,
				_outliningManagerService.GetOutliningManager(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<ChangeTag>(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<IVsVisibleTextMarkerTag>(textView),
				_tagAggregatorFactoryService.CreateTagAggregator<IErrorTag>(textView),
				dte.Debugger,
				scrollBar,
				new ColorSet(FormatMapService.GetEditorFormatMap(textView)));

			return progressiveScroll;
		}
开发者ID:jburrow,项目名称:progressive-scroll,代码行数:38,代码来源:ProgressiveScrollFactory.cs

示例5: RemoveVerticalScrollBar

 private void RemoveVerticalScrollBar(IWpfTextViewMargin container_margin)
 {
     var realScrollBarMargin = container_margin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;
     if (realScrollBarMargin != null)
     {
         realScrollBarMargin.VisualElement.MinWidth = 0.0;
         realScrollBarMargin.VisualElement.Width = 0.0;
     }
 }
开发者ID:shashClp,项目名称:RockMargin,代码行数:9,代码来源:RockMarginFactory.cs

示例6: Create

		public IGuidObjectsProvider Create(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin margin, string marginName) {
			if (wpfTextViewHost == null)
				throw new ArgumentNullException(nameof(wpfTextViewHost));
			if (margin == null)
				throw new ArgumentNullException(nameof(margin));
			if (marginName == null)
				throw new ArgumentNullException(nameof(marginName));
			if (margin.GetTextViewMargin(marginName) != margin)
				throw new ArgumentException();
			return new GuidObjectsProvider(wpfTextViewHost, margin, marginName, marginContextMenuHandlerProviders);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:MarginContextMenuService.cs

示例7: SimpleScrollBar

		public SimpleScrollBar(IWpfTextView textView, IWpfTextViewMargin containerMargin, IScrollMapFactoryService scrollMapFactory)
		{
			_textView = textView;
			_textView.LayoutChanged += OnLayoutChanged;
			Width = Options.ScrollBarWidth;

			_realScrollBarMargin = containerMargin.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar) as IWpfTextViewMargin;

			if (_realScrollBarMargin != null)
			{
				_realScrollBar = _realScrollBarMargin as IVerticalScrollBar;
				if (_realScrollBar != null)
				{
					_realScrollBarMargin.VisualElement.IsVisibleChanged += OnScrollBarIsVisibleChanged;
					_realScrollBar.TrackSpanChanged += OnScrollBarTrackSpanChanged;
				}
			}
			ResetTrackSpan();

			_scrollMapFactory = scrollMapFactory;
			ResetScrollMap();

			_scrollMap.MappingChanged += delegate { RaiseTrackChangedEvent(); };
		}
开发者ID:jburrow,项目名称:progressive-scroll,代码行数:24,代码来源:SimpleScrollBar.cs

示例8: GetAssociatedMouseProcessor

		public IMouseProcessor GetAssociatedMouseProcessor(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin margin) {
			if (margin.GetTextViewMargin(PredefinedMarginNames.Glyph) == margin)
				return wpfTextViewHost.TextView.Properties.GetOrCreateSingletonProperty(typeof(GlyphTextMarkerServiceMouseProcessor), () => new GlyphTextMarkerServiceMouseProcessor(glyphTextMarkerServiceImpl, wpfTextViewHost, margin));
			return null;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:5,代码来源:GlyphTextMarkerServiceMouseProcessor.cs

示例9: ScrollbarMargin

        /// <summary>
        /// Creates a <see cref="ScrollbarMargin"/> for a given <see cref="IWpfTextView"/>.
        /// </summary>
        /// <param name="textView">The <see cref="IWpfTextView"/> to attach the margin to.</param>
        /// <param name="marginContainer">Margin container. Is defined in the <see cref="ScrollbarMarginFactory"/> by the <see cref="MarginContainerAttribute"/>.</param>
        /// <param name="marginCore">The class which receives, processes and provides necessary data for <see cref="ScrollbarMargin"/>.</param>
        public ScrollbarMargin(IWpfTextView textView, IWpfTextViewMargin marginContainer, MarginCore marginCore)
        {
            Debug.WriteLine("Entering constructor.", MarginName);

            _textView = textView;
            _marginCore = marginCore;

            InitializeLayout();

            ITextViewMargin scrollBarMargin = marginContainer.GetTextViewMargin(PredefinedMarginNames.VerticalScrollBar);
            // ReSharper disable once SuspiciousTypeConversion.Global - scrollBarMargin is IVerticalScrollBar.
            _scrollBar = (IVerticalScrollBar)scrollBarMargin;

            marginCore.MarginRedraw += OnMarginCoreMarginRedraw;

            if (marginCore.IsActivated)
                DrawMargins(marginCore.GetChangedLines());
        }
开发者ID:modulexcite,项目名称:TfsPendingChangesMargin,代码行数:24,代码来源:ScrollbarMargin.cs


注:本文中的IWpfTextViewMargin.GetTextViewMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。