• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IWpfTextViewMargin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GlyphTextMarkerServiceMouseProcessor

		public GlyphTextMarkerServiceMouseProcessor(IGlyphTextMarkerServiceImpl glyphTextMarkerServiceImpl, IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin margin) {
			if (glyphTextMarkerServiceImpl == null)
				throw new ArgumentNullException(nameof(glyphTextMarkerServiceImpl));
			if (wpfTextViewHost == null)
				throw new ArgumentNullException(nameof(wpfTextViewHost));
			if (margin == null)
				throw new ArgumentNullException(nameof(margin));
			glyphTextViewMarkerService = GlyphTextViewMarkerService.GetOrCreate(glyphTextMarkerServiceImpl, wpfTextViewHost.TextView);
			this.wpfTextViewHost = wpfTextViewHost;
			this.margin = margin;
			toolTipDispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal, margin.VisualElement.Dispatcher);
			popup = new Popup { AllowsTransparency = true };

			var list = new List<IGlyphTextMarkerMouseProcessor>();
			foreach (var lazy in glyphTextMarkerServiceImpl.GlyphTextMarkerMouseProcessorProviders) {
				if (lazy.Metadata.TextViewRoles != null && !wpfTextViewHost.TextView.Roles.ContainsAny(lazy.Metadata.TextViewRoles))
					continue;
				var mouseProcessor = lazy.Value.GetAssociatedMouseProcessor(wpfTextViewHost, margin);
				if (mouseProcessor != null)
					list.Add(mouseProcessor);
			}
			glyphTextMarkerMouseProcessors = list.ToArray();
			wpfTextViewHost.TextView.Closed += TextView_Closed;
			wpfTextViewHost.TextView.LayoutChanged += TextView_LayoutChanged;
			toolTipDispatcherTimer.Tick += ToolTipDispatcherTimer_Tick;
			popup.Closed += Popup_Closed;
			glyphTextViewMarkerService.AddGlyphTextMarkerListener(this);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:28,代码来源:GlyphTextMarkerServiceMouseProcessor.cs


示例2: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost view_host, IWpfTextViewMargin container_margin)
        {
            IWpfTextView text_view = view_host.TextView;

            try
            {
                Utils.VSVersion = Assembly.GetCallingAssembly().GetName().Version.Major.ToString();
            }
            catch { }

            if (!PresenceSent)
            {
                PresenceSent = true;
                MonitoringService.SendPresense();
            }

            if (!SettingsLoaded)
                ReadSettings(OptionsService.GlobalOptions);

            RemoveVerticalScrollBar(container_margin);

            var navigator = TextStructureNavigatorService.GetTextStructureNavigator(text_view.TextBuffer);
            var format = FormatMapService.GetEditorFormatMap(text_view);
            var tagger = HighlightWordTagger.Instance(text_view, format, TextSearchService, navigator);
            var marks_enumerator = new MarksEnumerator(AggregatorFactoryService, text_view);
            var change_enumerator = new ChangeEnumerator(AggregatorFactoryService, text_view);
            var words_enumerator = new HighlightedWordsEnumerator(text_view, tagger);

            return new RockMargin(text_view, marks_enumerator, change_enumerator, words_enumerator, tagger);
        }
开发者ID:shashClp,项目名称:RockMargin,代码行数:30,代码来源:RockMarginFactory.cs


示例3: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            int iErrStat;

            //_contentTypeRegistryService = ContentTypeRegistryService;
            //_textBufferFactoryService = TextBufferFactoryService;

            //DTE2 dte = (DTE2)serviceProvider.GetService(typeof(DTE));

            //iErrStat = GetHiddenTextManager(serviceProvider);


            //IComponentModel componentModel = (IComponentModel)ServiceProvider.GlobalProvider.GetService(typeof(SComponentModel));
            //IVsEditorAdaptersFactoryService adapterFactoryService = componentModel.GetService<IVsEditorAdaptersFactoryService>();

            
            ////System.Diagnostics.Trace.WriteLine(":" + _textBufferFactoryService.TextContentType.ToString());
            //_curTextBuf = _textBufferFactoryService.CreateTextBuffer("test", _textBufferFactoryService.PlaintextContentType);

            foreach (IViewTaggerProvider vtp in viewTaggerProviderCollection)
            {
                if (vtp is TextInvisTaggerProvider)
                {
                    _titp = vtp as TextInvisTaggerProvider;
                    break;
                }
            }
            if (_titp == null)
            {
                System.Diagnostics.Trace.WriteLine("no valid tagger, exit");
                return null;
            }
            return new TestMargin(textViewHost.TextView, _titp.GetThyTagger());
        }
开发者ID:mintberry,项目名称:stackrecaller,代码行数:34,代码来源:TestMarginFactory.cs


示例4: LinkBanner

        IWpfTextViewMargin IWpfTextViewMarginProvider.CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
        {
            // If the notification has occured then there is nothing else to do.  We are done
            if (_vimApplicationSettings.HaveNotifiedBackspaceSetting)
            {
                return null;
            }

            // On the very first IVimBuffer creation the vimrc will be loaded.  Go ahead and
            // attempt to get / create the buffer to ensure the vimrc load has been attempted
            var wpfTextView = wpfTextViewHost.TextView;
            IVimBuffer vimBuffer;
            if (!_vim.TryGetOrCreateVimBufferForHost(wpfTextView, out vimBuffer))
            {
                return null;
            }

            // If there is no vimrc or the load does allow backspace over start then there
            // is no need to display the warning
            if (_vim.GlobalSettings.IsBackspaceStart || _vimApplicationSettings.UseEditorTabAndBackspace)
            {
                return null;
            }

            var editorFormatMap = _editorFormatMapService.GetEditorFormatMap(wpfTextView);
            var linkBanner = new LinkBanner();
            linkBanner.MarginName = Name;
            linkBanner.LinkAddress = "https://github.com/jaredpar/VsVim/wiki/FAQ#wiki-backspace";
            linkBanner.LinkText = "FAQ";
            linkBanner.BannerText = "You may want to change the backspace setting in your vimrc";
            linkBanner.Background = editorFormatMap.GetBackgroundBrush(EditorFormatDefinitionNames.Margin, MarginFormatDefinition.DefaultColor);
            linkBanner.CloseClicked += (sender, e) => { _vimApplicationSettings.HaveNotifiedBackspaceSetting = true; };
            return linkBanner;
        }
开发者ID:honeyhoneywell,项目名称:VsVim,代码行数:34,代码来源:BackspaceNotificationMarginProvider.cs


示例5: 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


示例6: GlyphMouseProcessor

 public GlyphMouseProcessor(IWpfTextViewHost host, IWpfTextViewMargin margin, ITagAggregator<IGlyphTag> aggregator)
 {
     this.theHost = host;
     this.theMargin = margin;
     this.tagAggregator = aggregator;
     this.theHost.Closed += OnTextViewHostClosed;
 }
开发者ID:ssatta,项目名称:viasfora,代码行数:7,代码来源:OutliningGlyphFactoryProvider.cs


示例7: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            string source = textViewHost.TextView.TextBuffer.CurrentSnapshot.GetText();
            ITextDocument document;

            if (TextDocumentFactoryService.TryGetTextDocument(textViewHost.TextView.TextDataModel.DocumentBuffer, out document))
            {
                switch (textViewHost.TextView.TextBuffer.ContentType.DisplayName.ToLowerInvariant())
                {
                    case "less":
                        bool showLess = WESettings.GetBoolean(WESettings.Keys.ShowLessPreviewWindow);
                        return new LessMargin("CSS", source, showLess, document);

                    case "coffeescript":
                        bool showCoffee = WESettings.GetBoolean(WESettings.Keys.ShowCoffeeScriptPreviewWindow);
                        return new CoffeeScriptMargin("JavaScript", source, showCoffee, document);

                    case "markdown":
                        bool showMarkdown = WESettings.GetBoolean(WESettings.Keys.MarkdownShowPreviewWindow);
                        return new MarkdownMargin("text", source, showMarkdown, document);
                }
            }

            return null;
        }
开发者ID:Russe11,项目名称:WebEssentials2013,代码行数:25,代码来源:EditorMarginFactory.cs


示例8: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            IWpfTextView view = textViewHost.TextView;

            // Files larger than 1 MB should be skipped to avoid hangs.
            if (view.TextSnapshot.Length > (1024 * 1024))
                return null;

            ITextDocument document;
            if (!_TextDocumentFactoryService.TryGetTextDocument(view.TextDataModel.DocumentBuffer, out document))
                return null;

            IVsExtensionManager manager = _serviceProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;
            if (manager == null)
                return null;

            IInstalledExtension extension;
            manager.TryGetInstalledExtension("FixMixedTabs", out extension);
            if (extension != null)
                return null;

            ITextUndoHistory history;
            if (!_UndoHistoryRegistry.TryGetHistory(view.TextBuffer, out history))
            {
                Debug.Fail("Unexpected: couldn't get an undo history for the given text buffer");
                return null;
            }

            return new InformationBarMargin(view, document, _OperationsFactory.GetEditorOperations(view), history);
        }
开发者ID:xornand,项目名称:VS-PPT,代码行数:30,代码来源:MarginFactory.cs


示例9: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            string source = textViewHost.TextView.TextBuffer.CurrentSnapshot.GetText();
            ITextDocument document;

            if (textViewHost.TextView.TextDataModel.DocumentBuffer.Properties.TryGetProperty(typeof(ITextDocument), out document))
            {
                switch (textViewHost.TextView.TextBuffer.ContentType.DisplayName)
                {
                    case "LESS":
                        bool showLess = WESettings.GetBoolean(WESettings.Keys.ShowLessPreviewWindow);
                        return new LessMargin("CSS", source, showLess, document);

                    //case "scss":
                    //    return new ScssMargin("CSS", source, true, document);

                    case "CoffeeScript":
                        bool showCoffee = WESettings.GetBoolean(WESettings.Keys.ShowCoffeeScriptPreviewWindow);
                        return new CoffeeScriptMargin("JavaScript", source, showCoffee, document);

                    //case "TypeScript":
                    //    if (!document.FilePath.EndsWith(".d.ts"))
                    //    {
                    //        bool showType = WESettings.GetBoolean(WESettings.Keys.ShowTypeScriptPreviewWindow);
                    //        return new TypeScriptMargin("TypeScript", source, showType, document);
                    //    }
                    //    break;

                    case "markdown":
                        return new MarkdownMargin("text", source, true, document);
                }
            }

            return null;
        }
开发者ID:joeriks,项目名称:WebEssentials2013,代码行数:35,代码来源:EditorMarginFactory.cs


示例10: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
        {
            if (!ExtensibilityToolsPackage.Options.ShowBottomMargin)
                return null;

            return new BottomMargin(wpfTextViewHost.TextView, _classifierService, _documentService);
        }
开发者ID:NotYours180,项目名称:ExtensibilityTools,代码行数:7,代码来源:BottomMarginFactory.cs


示例11: GetAssociatedMouseProcessor

 public IMouseProcessor GetAssociatedMouseProcessor(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin margin)
 {
     return new GlyphMouseProcessor(
     wpfTextViewHost, margin,
     aggregatorFactory.CreateTagAggregator<IGlyphTag>(wpfTextViewHost.TextView.TextBuffer)
     );
 }
开发者ID:ssatta,项目名称:viasfora,代码行数:7,代码来源:OutliningGlyphFactoryProvider.cs


示例12: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
        {
            string fileName = GetFileNameFromTextBuffer(wpfTextViewHost.TextView.TextBuffer);

            IEnumerable<SonarIssue> issues = _sonarIssuesService.GetIssuesForFile(fileName);

            return new SonarIssueTextViewMargin(issues, wpfTextViewHost, marginContainer, _scrollMapFactoryService);
        }
开发者ID:mpartipilo,项目名称:SonarCompanion,代码行数:8,代码来源:SonarIssueTextViewMarginProvider.cs


示例13: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            if (!VisualDHelper.setFactory(editorFactory))
                return null;

            //MessageBox.Show("CreateMargin");
            return new CoverageMargin(textViewHost.TextView, FormatMapService.GetEditorFormatMap(textViewHost.TextView));
        }
开发者ID:rainers,项目名称:visuald,代码行数:8,代码来源:CoverageMargin.cs


示例14: CreateMargin

        public override IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            var marginCore = TryGetMarginCore(textViewHost);
            if (marginCore == null)
                return null;

            return new EditorDiffMargin(textViewHost.TextView, marginCore);
        }
开发者ID:haiiev,项目名称:GitDiffMargin,代码行数:8,代码来源:EditorDiffMarginFactory.cs


示例15: GetGlyphFactory

        public IGlyphFactory GetGlyphFactory(IWpfTextView view, IWpfTextViewMargin margin)
        {
            AccentGlyphFactory factory = new AccentGlyphFactory();
            factory.View = view;
            factory.FormatMapService = FormatMapService;

            return factory;
        }
开发者ID:coderfin,项目名称:AccentOccurrences,代码行数:8,代码来源:AccentGlyphFactoryProvider.cs


示例16: CreateMargin

 public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
 {
     return new RelativeNumber(
         textViewHost.TextView, 
         FormatMapService.GetEditorFormatMap(textViewHost.TextView), 
         containerMargin,
         OutliningManagerService.GetOutliningManager(textViewHost.TextView));
 }
开发者ID:jhamm,项目名称:relativenumber,代码行数:8,代码来源:RelativeNumberFactory.cs


示例17: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
        {
            var generalOptions = Setting.getGeneralOptions(serviceProvider);
            if (generalOptions == null || !(generalOptions.UnusedReferencesEnabled || generalOptions.UnusedOpensEnabled)) return null;

             	        var textView = wpfTextViewHost.TextView;
            return new UnusedDeclarationMargin(textView, marginContainer,
                           classifierAggregatorService.GetClassifier(textView.TextBuffer));
        }
开发者ID:rojepp,项目名称:VisualFSharpPowerTools,代码行数:9,代码来源:UnusedDeclarationMarginProvider.cs


示例18: Create

		public IWpfTextViewMarginProviderCollection Create(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer, string marginContainerName) {
			if (wpfTextViewHost == null)
				throw new ArgumentNullException(nameof(wpfTextViewHost));
			if (marginContainer == null)
				throw new ArgumentNullException(nameof(marginContainer));
			if (marginContainerName == null)
				throw new ArgumentNullException(nameof(marginContainerName));
			return new WpfTextViewMarginProviderCollection(wpfTextViewMarginProviders, wpfTextViewHost, marginContainer, marginContainerName);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:WpfTextViewMarginProviderCollectionProvider.cs


示例19: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer)
        {
            var generalOptions = Utils.GetGeneralOptionsPage(serviceProvider);
            if (!generalOptions.UnusedDeclarationsEnabled) return null;

 	        var textView = wpfTextViewHost.TextView;
            return new UnusedDeclarationMargin(textView, marginContainer,
                           classifierAggregatorService.GetClassifier(textView.TextBuffer));
        }
开发者ID:MarcinJuraszek,项目名称:VisualFSharpPowerTools,代码行数:9,代码来源:UnusedDeclarationMarginProvider.cs


示例20: CreateMargin

        public IWpfTextViewMargin CreateMargin(IWpfTextViewHost textViewHost, IWpfTextViewMargin containerMargin)
        {
            if (!(textViewHost.TextView.TextBuffer is IProjectionBuffer))
            {
                return null;
            }

            return new VenusMargin(textViewHost.TextView, _textEditorFactory);
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:VenusMarginFactory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IWrappedCollection类代码示例发布时间:2022-05-24
下一篇:
C# IWpfTextViewHost类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap