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

C# IQuickInfoSession类代码示例

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

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



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

示例1: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(
        IQuickInfoSession session, IList<object> quickInfoContent,
        out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;
              SnapshotPoint? subjectTriggerPoint =
            session.GetTriggerPoint(textBuffer.CurrentSnapshot);
              if ( !subjectTriggerPoint.HasValue ) {
            return;
              }
              ITextSnapshot currentSnapshot = subjectTriggerPoint.Value.Snapshot;
              SnapshotSpan querySpan = new SnapshotSpan(subjectTriggerPoint.Value, 0);

              var tagAggregator = GetAggregator(session);
              TextExtent extent = FindExtentAtPoint(subjectTriggerPoint);

              if ( CheckForPrefixTag(tagAggregator, extent.Span) ) {
            string text = extent.Span.GetText();
            string url = FindNSUri(extent.Span, GetDocText(extent.Span));
            applicableToSpan = currentSnapshot.CreateTrackingSpan(
              extent.Span, SpanTrackingMode.EdgeInclusive
            );
            String toolTipText = String.Format("Prefix: {0}\r\nNamespace: {1}", text, url);
            quickInfoContent.Add(toolTipText);
              }
        }
开发者ID:tomasr,项目名称:BetterXml,代码行数:26,代码来源:QuickInfo.cs


示例2: AugmentQuickInfoSession

		public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
		{
			applicableToSpan = null;

			var triggerPoint = session.GetTriggerPoint(buffer.CurrentSnapshot);
			if (triggerPoint == null)
				return;

			ITextDocument doc;
			if (!provider.TextDocumentFactoryService.TryGetTextDocument(buffer, out doc))
				return;

			IOutputWindowPane diagnostics = provider.OutputWindowService.TryGetPane(OutputWindowPanes.DartVSDiagnostics);
			if (diagnostics != null)
				diagnostics.WriteLine("Quick info requested for: " + doc.FilePath);

			// Figure out if this is a recalculate for an existing span (not sure if this is the best way of supporting async...?)
			if (inProgressPosition != null && inProgressPosition.Value == triggerPoint.Value.Position)
			{
				UpdateTooltip(session, quickInfoContent, out applicableToSpan);
			}
			else
			{
				applicableToSpan = GetApplicableToSpan(triggerPoint);
				var ignoredTask = StartTooltipRequestAsync(session, quickInfoContent, applicableToSpan, triggerPoint, doc.FilePath);
			}
		}
开发者ID:modulexcite,项目名称:DartVS,代码行数:27,代码来源:QuickInfoSourceProvider.cs


示例3: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (session == null || qiContent == null)
                return;

            // Map the trigger point down to our buffer.
            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            JSONEditorDocument doc = JSONEditorDocument.FromTextBuffer(_buffer);
            JSONParseItem item = doc.JSONDocument.ItemBeforePosition(point.Value.Position);

            if (item == null || !item.IsValid)
                return;

            JSONMember dependency = item.FindType<JSONMember>();
            if (dependency == null || dependency.Name != item)
                return;

            var parent = dependency.Parent.FindType<JSONMember>();
            if (parent == null || !parent.UnquotedNameText.EndsWith("dependencies", StringComparison.OrdinalIgnoreCase))
                return;

            applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(item.Start, item.Length, SpanTrackingMode.EdgeNegative);

            UIElement element = CreateTooltip(dependency.UnquotedNameText, item);

            if (element != null)
                qiContent.Add(element);
        }
开发者ID:lurumad,项目名称:JSON-Intellisense,代码行数:33,代码来源:QuickInfoSourceBase.cs


示例4: QuickInfoPresenterSession

 public QuickInfoPresenterSession(IQuickInfoBroker quickInfoBroker, ITextView textView, ITextBuffer subjectBuffer, IQuickInfoSession sessionOpt)
 {
     _quickInfoBroker = quickInfoBroker;
     _textView = textView;
     _subjectBuffer = subjectBuffer;
     _editorSessionOpt = sessionOpt;
 }
开发者ID:GeertVL,项目名称:roslyn,代码行数:7,代码来源:QuickInfoPresenter.QuickInfoPresenterSession.cs


示例5: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }

            if (quickInfoContent == null)
            {
                throw new ArgumentNullException("quickInfoContent");
            }

            TemplateAnalysis analysis = this.analyzer.CurrentAnalysis;
            SnapshotPoint? triggerPoint = session.GetTriggerPoint(analysis.TextSnapshot);
            if (triggerPoint != null && analysis.Template != null)
            {
                string description;
                Span applicableTo;
                if (analysis.Template.TryGetDescription(triggerPoint.Value.Position, out description, out applicableTo))
                {
                    quickInfoContent.Add(description);
                    applicableToSpan = analysis.TextSnapshot.CreateTrackingSpan(applicableTo, SpanTrackingMode.EdgeExclusive); 
                    return;                    
                }
            }

            applicableToSpan = null;
        }
开发者ID:icool123,项目名称:T4Toolbox,代码行数:28,代码来源:TemplateQuickInfoSource.cs


示例6: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan) {
            applicableToSpan = null;

            var modifier = ModifierKeys.Control | ModifierKeys.Shift;
            if((Keyboard.Modifiers & modifier) != modifier) {
                return;
            }

            var parseResult = ParserService.ParseResult;
            if (parseResult == null) {
                return;
            }
            // Map the trigger point down to our buffer.
            SnapshotPoint? subjectTriggerPoint = session.GetTriggerPoint(parseResult.Snapshot);
            if(!subjectTriggerPoint.HasValue) {
                return;
            }

            var triggerToken = parseResult.SyntaxTree.Tokens.FindAtPosition(subjectTriggerPoint.Value.Position);

            if(triggerToken.IsMissing || triggerToken.Parent == null) {
                return;
            }

            var location = triggerToken.GetLocation();
            qiContent.Add($"{triggerToken.Type} ({triggerToken.Classification}) Ln {location?.StartLine + 1} Ch {location?.StartCharacter + 1}\r\n{triggerToken.Parent?.GetType().Name}");

            applicableToSpan = parseResult.Snapshot.CreateTrackingSpan(
                triggerToken.Start,
                triggerToken.Length,
                SpanTrackingMode.EdgeExclusive);
        }
开发者ID:IInspectable,项目名称:Nav.Language.Extensions,代码行数:32,代码来源:DebugQuickInfoSource.cs


示例7: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            SnapshotPoint? triggerPoint = session.GetTriggerPoint(TextBuffer.CurrentSnapshot);
            if (!triggerPoint.HasValue)
            {
                applicableToSpan = null;
                return;
            }

            JavaQuickInfo qi = null;
            if (session.Properties.TryGetProperty<JavaQuickInfo>(typeof(JavaQuickInfo), out qi))
            {
                //quickInfoContent.Clear();
                foreach (var o in qi.QuickInfoContent)
                {
                    var display = o;
                    if (display.Contains("{"))
                        display = display.Substring(0, display.IndexOf("{"));
                    if (display.Contains("[in"))
                        display = display.Substring(0, display.IndexOf("[in"));
                    //quickInfoContent.Add(o);
                    quickInfoContent.Add(display); // TODO: Workaround to only show the declaration of the type and not the full location string
                }

                // Get whole word under point
                ITextStructureNavigator navigator = Provider.NavigatorService.GetTextStructureNavigator(TextBuffer);
                TextExtent extent = navigator.GetExtentOfWord(triggerPoint.Value);

                applicableToSpan = triggerPoint.Value.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive);
            }
            else
                applicableToSpan = null;
        }
开发者ID:XewTurquish,项目名称:vsminecraft,代码行数:33,代码来源:JavaQuickInfo.cs


示例8: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (!EnsureTreeInitialized() || session == null || qiContent == null)
                return;

            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            ParseItem item = _tree.StyleSheet.ItemBeforePosition(point.Value.Position);
            if (item == null || !item.IsValid)
                return;

            UrlItem urlItem = item.FindType<UrlItem>();

            if (urlItem != null && urlItem.UrlString != null && urlItem.UrlString.IsValid)
            {
                string url = GetFileName(urlItem.UrlString.Text.Trim('\'', '"'));
                if (!string.IsNullOrEmpty(url))
                {
                    applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(point.Value.Position, 1, SpanTrackingMode.EdgeNegative);
                    var image = CreateImage(url);
                    if (image != null && image.Source != null)
                    {
                        qiContent.Add(image);
                        qiContent.Add(Math.Round(image.Source.Width) + "x" + Math.Round(image.Source.Height));
                    }
                }
            }
        }
开发者ID:LogoPhonix,项目名称:WebEssentials2012,代码行数:32,代码来源:ImageQuickInfo.cs


示例9: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (!EnsureTreeInitialized() || session == null || qiContent == null)
                return;

            // Map the trigger point down to our buffer.
            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            ParseItem item = _tree.StyleSheet.ItemBeforePosition(point.Value.Position);
            if (item == null || !item.IsValid)
                return;

            Declaration dec = item.FindType<Declaration>();
            if (dec == null || !dec.IsValid || !_allowed.Contains(dec.PropertyName.Text.ToUpperInvariant()))
                return;

            string fontName = item.Text.Trim('\'', '"');

            if (fonts.Families.SingleOrDefault(f => f.Name.Equals(fontName, StringComparison.OrdinalIgnoreCase)) != null)
            {
                FontFamily font = new FontFamily(fontName);

                applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(item.Start, item.Length, SpanTrackingMode.EdgeNegative);
                qiContent.Add(CreateFontPreview(font, 10));
                qiContent.Add(CreateFontPreview(font, 11));
                qiContent.Add(CreateFontPreview(font, 12));
                qiContent.Add(CreateFontPreview(font, 14));
                qiContent.Add(CreateFontPreview(font, 25));
                qiContent.Add(CreateFontPreview(font, 40));
            }
        }
开发者ID:joeriks,项目名称:WebEssentials2013,代码行数:35,代码来源:FontQuickInfo.cs


示例10: HACK_SetShimQuickInfoSessionWorker

 private void HACK_SetShimQuickInfoSessionWorker(ITextView textView, IQuickInfoSession quickInfoSession)
 {
     var properties = textView.Properties.PropertyList;
     var shimController = properties.Single(p => p.Value != null && p.Value.GetType().Name == "ShimQuickInfoController").Value;
     var sessionField = shimController.GetType().GetField("_session", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
     sessionField.SetValue(shimController, quickInfoSession);
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:HACK_EventHookupDismissalOnBufferChangePreventerService.cs


示例11: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (session == null || qiContent == null)
                return;

            // Map the trigger point down to our buffer.
            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            var snapshot = _buffer.CurrentSnapshot;
            var classifier = _classifierService.GetClassifier(_buffer);

            var doc = new SnapshotSpan(snapshot, 0, snapshot.Length);
            var line = point.Value.GetContainingLine();
            var idents = classifier.GetClassificationSpans(line.Extent);

            bool handled = HandleVariables(qiContent, ref applicableToSpan, idents, point);

            if (handled)
                return;

            HandleKeywords(qiContent, ref applicableToSpan, idents, point);
        }
开发者ID:yannduran,项目名称:OpenCommandLine,代码行数:26,代码来源:CmdQuickInfo.cs


示例12: AnalyzeExpression

 private ExpressionAnalysis AnalyzeExpression(IQuickInfoSession session) {
     return VsProjectAnalyzer.AnalyzeExpression(
         _textBuffer.CurrentSnapshot,
         session.CreateTrackingSpan(_textBuffer),
         false
     );
 }
开发者ID:lioaphy,项目名称:nodejstools,代码行数:7,代码来源:QuickInfoSource.cs


示例13: AugmentQuickInfoSession

            public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
            {
                applicableToSpan = null;

                object eventHookupValue;
                if (quickInfoContent.Count != 0 ||
                    session.Properties.TryGetProperty(QuickInfoUtilities.EventHookupKey, out eventHookupValue))
                {
                    // No quickinfo if it's the event hookup popup.
                    return;
                }

                var position = session.GetTriggerPoint(_subjectBuffer.CurrentSnapshot);
                if (position.HasValue)
                {
                    var textView = session.TextView;
                    var args = new InvokeQuickInfoCommandArgs(textView, _subjectBuffer);

                    Controller controller;
                    if (_commandHandler.TryGetController(args, out controller))
                    {
                        controller.InvokeQuickInfo(position.Value, trackMouse: true, augmentSession: session);
                    }
                }
            }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:25,代码来源:QuickInfoCommandHandlerAndSourceProvider.QuickInfoSource.cs


示例14: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (!EnsureTreeInitialized() || session == null || qiContent == null)
                return;

            // Map the trigger point down to our buffer.
            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            ParseItem item = _tree.StyleSheet.ItemBeforePosition(point.Value.Position);
            if (item == null || !item.IsValid)
                return;

            Selector sel = item.FindType<Selector>();
            if (sel == null)
                return;
            // Mixins don't have specificity
            if (sel.SimpleSelectors.Count == 1 && sel.SimpleSelectors[0].SubSelectors.Count == 1 && sel.SimpleSelectors[0].SubSelectors[0] is LessMixinDeclaration)
                return;

            applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(item.Start, item.Length, SpanTrackingMode.EdgeNegative);

            string content = GenerateContent(sel);
            qiContent.Add(content);
        }
开发者ID:ncl-dmoreira,项目名称:WebEssentials2013,代码行数:28,代码来源:SelectorQuickInfo.cs


示例15: AugmentQuickInfoSession

        /// <summary>
        /// Determine which pieces of Quickinfo content should be displayed
        /// </summary>
        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (_disposed)
                throw new ObjectDisposedException("TestQuickInfoSource");

            var triggerPoint = (SnapshotPoint) session.GetTriggerPoint(_buffer.CurrentSnapshot);

            if (triggerPoint == null)
                return;

            foreach (IMappingTagSpan<OokTokenTag> curTag in _aggregator.GetTags(new SnapshotSpan(triggerPoint, triggerPoint)))
            {
                if (curTag.Tag.type == OokTokenTypes.OokExclamation)
                {
                    var tagSpan = curTag.Span.GetSpans(_buffer).First();
                    applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);
                    quickInfoContent.Add("Exclaimed Ook!");
                }
                else if (curTag.Tag.type == OokTokenTypes.OokQuestion)
                {
                    var tagSpan = curTag.Span.GetSpans(_buffer).First();
                    applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);
                    quickInfoContent.Add("Question Ook?");
                }
                else if (curTag.Tag.type == OokTokenTypes.OokPeriod)
                {
                    var tagSpan = curTag.Span.GetSpans(_buffer).First();
                    applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);
                    quickInfoContent.Add("Regular Ook.");
                }
            }
        }
开发者ID:luyikk,项目名称:NLUATool,代码行数:37,代码来源:OokQuickInfoSource.cs


示例16: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (session == null || qiContent == null || qiContent.Count > 0)
                return;

            // Map the trigger point down to our buffer.
            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            var doc = JSONEditorDocument.FromTextBuffer(_buffer);
            JSONParseItem item = doc.JSONDocument.ItemBeforePosition(point.Value.Position);
            if (item == null || !item.IsValid)
                return;

            JSONMember member = item.FindType<JSONMember>();
            if (member == null || member.Name == null)
                return;

            IJSONSchema schema = _schemaResolver.DetermineSchemaForTextBuffer(_buffer);

            if (schema != null)
            {
                IJSONSchemaPropertyNameCompletionInfo info = GetInfo(schema, member);

                if (info != null && !string.IsNullOrEmpty(info.PropertyDocumentation))
                {
                    applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(item.Start, item.Length, SpanTrackingMode.EdgeNegative);
                    qiContent.Add(info.DisplayText + Environment.NewLine + info.PropertyDocumentation);
                }
            }
        }
开发者ID:GProulx,项目名称:WebEssentials2013,代码行数:34,代码来源:PropertyQuickInfo.cs


示例17: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            var triggerPoint = (SnapshotPoint)session.GetTriggerPoint(_buffer.CurrentSnapshot);

            if (triggerPoint == null)
                return;

            // find each span that looks like a token and look it up in the dictionary
            foreach (IMappingTagSpan<PkgDefTokenTag> curTag in _aggregator.GetTags(new SnapshotSpan(triggerPoint, triggerPoint)))
            {
                if (curTag.Tag.type == PkgDefLanguageTokens.Token)
                {
                    SnapshotSpan tagSpan = curTag.Span.GetSpans(_buffer).First();
                    if (PkgDefTokenTagger.ValidTokens.Keys.Contains(tagSpan.GetText()))
                    {
                        applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(tagSpan, SpanTrackingMode.EdgeExclusive);
                        string quickInfo = PkgDefTokenTagger.ValidTokens[tagSpan.GetText()];
                        System.Diagnostics.Debug.WriteLine(quickInfo);
                        quickInfoContent.Add(quickInfo);
                    }
                }
            }
        }
开发者ID:smartmobili,项目名称:parsing,代码行数:25,代码来源:PkgDefTokenQuickInfoSource.cs


示例18: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan) {
            applicableToSpan = null;

            var semanticModelResult = SemanticModelService.SemanticModelResult;
            if (semanticModelResult == null) {
               return;
            }

            // Map the trigger point down to our buffer.
            SnapshotPoint? subjectTriggerPoint = session.GetTriggerPoint(semanticModelResult.Snapshot);
            if (!subjectTriggerPoint.HasValue) {
                return;
            }
           
            var triggerSymbol = semanticModelResult.CompilationUnit.Symbols.FindAtPosition(subjectTriggerPoint.Value.Position);

            if (triggerSymbol == null) {
                return;
            }

            foreach(var content in SymbolQuickInfoBuilder.Build(triggerSymbol, SyntaxQuickinfoBuilderService)) {                 
                qiContent.Add(content);
            }
            
            var location = triggerSymbol.Location;
            applicableToSpan = semanticModelResult.Snapshot.CreateTrackingSpan(
                    location.Start,
                    location.Length,
                    SpanTrackingMode.EdgeExclusive);
        }
开发者ID:csharper2010,项目名称:Nav.Language.Extensions,代码行数:30,代码来源:SymbolQuickInfoSource.cs


示例19: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            if (!EnsureTreeInitialized() || session == null || qiContent == null)
                return;

            // Map the trigger point down to our buffer.
            SnapshotPoint? point = session.GetTriggerPoint(_buffer.CurrentSnapshot);
            if (!point.HasValue)
                return;

            ParseItem item = _tree.StyleSheet.ItemBeforePosition(point.Value.Position);
            if (item == null || !item.IsValid)
                return;

            RuleSet rule = item.FindType<RuleSet>();
            if (rule == null)
                return;

            applicableToSpan = _buffer.CurrentSnapshot.CreateTrackingSpan(item.Start, item.Length, SpanTrackingMode.EdgeNegative);
            var fileName = _buffer.GetFileName().ToLowerInvariant();
            var unmatchedEntry = UsageRegistry.GetAllUnusedRules().FirstOrDefault(x => x.File == fileName && x.Is(rule));

            if(unmatchedEntry == null)
            {
                return;
            }

            qiContent.Add("No usages of this rule have been found");
        }
开发者ID:robert-hoffmann,项目名称:WebEssentials2013,代码行数:31,代码来源:UnusedSelectorQuickInfo.cs


示例20: AugmentQuickInfoSession

        public void AugmentQuickInfoSession(IQuickInfoSession session, IList<object> qiContent, out ITrackingSpan applicableToSpan)
        {
            applicableToSpan = null;

            SnapshotPoint? point = session.GetTriggerPoint(session.TextView.TextBuffer.CurrentSnapshot);

            if (!point.HasValue)
                return;

            HtmlEditorTree tree = HtmlEditorDocument.FromTextView(session.TextView).HtmlEditorTree;

            ElementNode node = null;
            AttributeNode attr = null;

            tree.GetPositionElement(point.Value.Position, out node, out attr);

            if (node == null || !node.Name.Equals("img", StringComparison.OrdinalIgnoreCase))
                return;
            if (attr == null || !attr.Name.Equals("src", StringComparison.OrdinalIgnoreCase))
                return;

            string url = ImageQuickInfo.GetFullUrl(attr.Value, session.TextView.TextBuffer);
            if (string.IsNullOrEmpty(url))
                return;

            applicableToSpan = session.TextView.TextBuffer.CurrentSnapshot.CreateTrackingSpan(point.Value.Position, 1, SpanTrackingMode.EdgeNegative);

            ImageQuickInfo.AddImageContent(qiContent, url);
        }
开发者ID:Gordon-Beeming,项目名称:WebEssentials2013,代码行数:29,代码来源:ImageQuickInfo.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IQuickTaskProvider类代码示例发布时间:2022-05-24
下一篇:
C# IQueuedEmailService类代码示例发布时间: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