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

C# ITrackingPoint类代码示例

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

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



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

示例1: Model

        private Model(
            DisconnectedBufferGraph disconnectedBufferGraph,
            IList<CompletionItem> totalItems,
            IList<CompletionItem> filteredItems,
            CompletionItem selectedItem,
            bool isHardSelection,
            bool isUnique,
            bool useSuggestionCompletionMode,
            CompletionItem builder,
            CompletionItem defaultBuilder,
            CompletionTriggerInfo triggerInfo,
            ITrackingPoint commitSpanEndPoint,
            bool dismissIfEmpty)
        {
            Contract.ThrowIfNull(selectedItem);
            Contract.ThrowIfFalse(totalItems.Count != 0, "Must have at least one item.");
            Contract.ThrowIfFalse(filteredItems.Count != 0, "Must have at least one filtered item.");
            Contract.ThrowIfFalse(filteredItems.Contains(selectedItem) || defaultBuilder == selectedItem, "Selected item must be in filtered items.");

            _disconnectedBufferGraph = disconnectedBufferGraph;
            this.TotalItems = totalItems;
            this.FilteredItems = filteredItems;
            this.SelectedItem = selectedItem;
            this.IsHardSelection = isHardSelection;
            this.IsUnique = isUnique;
            this.UseSuggestionCompletionMode = useSuggestionCompletionMode;
            this.Builder = builder;
            this.DefaultBuilder = defaultBuilder;
            this.TriggerInfo = triggerInfo;
            this.CommitTrackingSpanEndPoint = commitSpanEndPoint;
            this.DismissIfEmpty = dismissIfEmpty;
        }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:32,代码来源:Model.cs


示例2: GoToSourceImpl

        public override IEnumerable<INavigateToTarget> GoToSourceImpl(VSOBJGOTOSRCTYPE gotoSourceType, ITrackingPoint triggerPoint)
        {
            if (triggerPoint == null)
                return new INavigateToTarget[0];

            return base.GoToSourceImpl(gotoSourceType, triggerPoint);
        }
开发者ID:fjnogueira,项目名称:JavaForVS,代码行数:7,代码来源:JavaIntellisenseController.cs


示例3: FindTokenSpanAtPosition

 private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession session)
 {
     SnapshotPoint currentPoint = (session.TextView.Caret.Position.BufferPosition);
     ITextStructureNavigator navigator = _provider.NavigatorService.GetTextStructureNavigator(_textBuffer);
     TextExtent extent = navigator.GetExtentOfWord(currentPoint);
     return currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive);
 }
开发者ID:rdterner,项目名称:PerspexVS,代码行数:7,代码来源:CompletionSource.cs


示例4: FindTokenSpanAtPosition

 private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, IIntellisenseSession session)
 {
     var currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1;
     var navigator = _sourceProvider.NavigatorService.GetTextStructureNavigator(_textBuffer);
     var extent = navigator.GetExtentOfWord(currentPoint);
     return currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive);
 }
开发者ID:ketiko,项目名称:VSSparkExtension,代码行数:7,代码来源:SparkCompletionSource.cs


示例5: Model

        private Model(
            DisconnectedBufferGraph disconnectedBufferGraph,
            IList<CompletionItem> totalItems,
            IList<CompletionItem> filteredItems,
            CompletionItem selectedItem,
            ImmutableArray<CompletionItemFilter> completionItemFilters,
            ImmutableDictionary<CompletionItemFilter, bool> filterState,
            IReadOnlyDictionary<CompletionItem, string> completionItemToFilterText,
            bool isHardSelection,
            bool isUnique,
            bool useSuggestionCompletionMode,
            CompletionItem builder,
            CompletionItem defaultBuilder,
            CompletionTriggerInfo triggerInfo,
            ITrackingPoint commitSpanEndPoint,
            bool dismissIfEmpty)
        {
            Contract.ThrowIfFalse(totalItems.Count != 0, "Must have at least one item.");

            _disconnectedBufferGraph = disconnectedBufferGraph;
            this.TotalItems = totalItems;
            this.FilteredItems = filteredItems;
            this.FilterState = filterState;
            this.SelectedItem = selectedItem;
            this.CompletionItemFilters = completionItemFilters;
            this.CompletionItemToFilterText = completionItemToFilterText;
            this.IsHardSelection = isHardSelection;
            this.IsUnique = isUnique;
            this.UseSuggestionCompletionMode = useSuggestionCompletionMode;
            this.Builder = builder;
            this.DefaultBuilder = defaultBuilder;
            this.TriggerInfo = triggerInfo;
            this.CommitTrackingSpanEndPoint = commitSpanEndPoint;
            this.DismissIfEmpty = dismissIfEmpty;
        }
开发者ID:Eyas,项目名称:roslyn,代码行数:35,代码来源:Model.cs


示例6: FindTokenSpanAtPosition

        private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession session, out bool isUpperCase)
        {
            SnapshotPoint currentPoint = (session.TextView.Caret.Position.BufferPosition) - 1;
             ITextStructureNavigator navigator = sourceProvider.NavigatorService.GetTextStructureNavigator(textBuffer);
             TextExtent extent = navigator.GetExtentOfWord(currentPoint);

             string text = extent.Span.GetText();
             string strText = navigator.GetExtentOfWord((session.TextView.Caret.Position.BufferPosition) - text.Length - 1).Span.GetText();
             int uppercasePosition = 0;
             int underscorePosition = 0;

             if (NLAConfiguration.UnderscoreSeparator)
             {
            uppercasePosition = text.LastIndexOf("_");
            if (uppercasePosition > 0)
            {
               uppercasePosition = uppercasePosition + 1; // get passed the underscore character
               underscorePosition = uppercasePosition;
            }
             }
             else if (NLAConfiguration.UpperCaseSeparator)
             {
            uppercasePosition = text.LastIndexOf(text.LastOrDefault(c => char.IsUpper(c)));
            underscorePosition = uppercasePosition - 1;
             }

             isUpperCase = char.IsUpper(text[0]);
             if (!NLAConfiguration.AllowInStrings)
             {
            var line = currentPoint.GetContainingLine();
            var doubleQuote = line.GetText().IndexOf("\"");
            var singleQuote = line.GetText().IndexOf("'");

            if ((doubleQuote >= 0 && line.Start.Position + doubleQuote <= currentPoint.Position) || (singleQuote >= 0 && line.Start.Position + singleQuote <= currentPoint.Position))
            {
               return null;
            }
             }

             if (uppercasePosition > 0)
             {
            var span = currentPoint.Snapshot.CreateTrackingSpan(extent.Span.Start.Position + uppercasePosition, text.Length - uppercasePosition, SpanTrackingMode.EdgeInclusive);
            var underscoreSpan = currentPoint.Snapshot.CreateTrackingSpan(extent.Span.Start.Position + underscorePosition, text.Length - underscorePosition, SpanTrackingMode.EdgeInclusive);

            if (!NLAConfiguration.UnderscoreSeparator && underscoreSpan.GetText(currentPoint.Snapshot).StartsWith("_")) // avoid this "word_Composition" when camel case is not active
            {
               return null;
            }

            text = span.GetText(currentPoint.Snapshot);
            if (!String.IsNullOrEmpty(text))
            {
               isUpperCase = char.IsUpper(text[0]);
            }
            return span;
             }

             return currentPoint.Snapshot.CreateTrackingSpan(extent.Span, SpanTrackingMode.EdgeInclusive);
        }
开发者ID:kfmaurice,项目名称:nla,代码行数:59,代码来源:NLACompletionSource.cs


示例7: FindTokenSpanAtPosition

        private ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession completionSession)
        {
            SnapshotPoint ssPoint = (completionSession.TextView.Caret.Position.BufferPosition) - 1;
            ITextStructureNavigator navigator = sourceProvider.TextNavigatorService.GetTextStructureNavigator(this.textBuffer);
            TextExtent textExtent = navigator.GetExtentOfWord(ssPoint);
            return ssPoint.Snapshot.CreateTrackingSpan(textExtent.Span, SpanTrackingMode.EdgeInclusive);

        }
开发者ID:WilliamChao,项目名称:ShaderlabVS,代码行数:8,代码来源:ShaderlabCodeCompletion.cs


示例8: TriggerQuickInfo

		public IQuickInfoSession TriggerQuickInfo(ITextView textView, ITrackingPoint triggerPoint, bool trackMouse) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			var session = CreateQuickInfoSession(textView, triggerPoint, trackMouse);
			session.Start();
			return session.IsDismissed ? null : session;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:QuickInfoBroker.cs


示例9: TriggerSignatureHelp

		public ISignatureHelpSession TriggerSignatureHelp(ITextView textView, ITrackingPoint triggerPoint, bool trackCaret) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			var session = CreateSignatureHelpSession(textView, triggerPoint, trackCaret);
			session.Start();
			return session.IsDismissed ? null : session;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:9,代码来源:SignatureHelpBroker.cs


示例10: CreateQuickInfoSession

		public IQuickInfoSession CreateQuickInfoSession(ITextView textView, ITrackingPoint triggerPoint, bool trackMouse) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			var stack = intellisenseSessionStackMapService.Value.GetStackForTextView(textView);
			var session = new QuickInfoSession(textView, triggerPoint, trackMouse, intellisensePresenterFactoryService.Value, quickInfoSourceProviders);
			stack.PushSession(session);
			return session;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:QuickInfoBroker.cs


示例11: GetTriggerPoint

		public static SnapshotPoint? GetTriggerPoint(ITextView textView, ITrackingPoint triggerPoint, ITextSnapshot textSnapshot) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			if (textSnapshot == null)
				throw new ArgumentNullException(nameof(textSnapshot));

			return triggerPoint.GetPoint(textView.TextSnapshot);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:IntellisenseSessionHelper.cs


示例12: CreateSignatureHelpSession

		public ISignatureHelpSession CreateSignatureHelpSession(ITextView textView, ITrackingPoint triggerPoint, bool trackCaret) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			var stack = intellisenseSessionStackMapService.Value.GetStackForTextView(textView);
			var session = new SignatureHelpSession(textView, triggerPoint, trackCaret, intellisensePresenterFactoryService.Value, signatureHelpSourceProviders);
			currentLineSpaceReservationService.Value.SessionCreated(session);
			stack.PushSession(session);
			return session;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:SignatureHelpBroker.cs


示例13: CreateSmartTagSession

 public ISmartTagSession CreateSmartTagSession(ITextView textView, SmartTagType type, ITrackingPoint triggerPoint, SmartTagState state) {
     var session = new MockSmartTagSession(this) {
         TextView = textView,
         Type = type,
         TriggerPoint = triggerPoint,
         State = state
     };
     lock (_sessions) {
         _sessions.Add(new KeyValuePair<ITextView, ISmartTagSession>(textView, session));
     }
     session.Dismissed += Session_Dismissed;
     return session;
 }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:13,代码来源:MockSmartTagBroker.cs


示例14: Setup

        public void Setup()
        {
            _stubSession = MockRepository.GenerateStub<ICompletionSession>();
            _stubTextBuffer = MockRepository.GenerateStub<ITextBuffer>();
            _stubViewExplorer = MockRepository.GenerateStub<IViewExplorer>();
            _stubTrackingPoint = MockRepository.GenerateStub<ITrackingPoint>();
            _stubTrackingSpan = MockRepository.GenerateStub<ITrackingSpan>();
            _stubSnapshot = MockRepository.GenerateStub<ITextSnapshot>();

            _stubTextBuffer.Stub(x => x.CurrentSnapshot).Return(_stubSnapshot);
            _stubSession.Stub(x => x.GetTriggerPoint(_stubTextBuffer)).Return(_stubTrackingPoint);
            _stubTrackingPoint.Stub(x => x.GetPoint(_stubSnapshot)).Return(new SnapshotPoint(_stubSnapshot, 0));
            _stubViewExplorer.Stub(x => x.GetRelatedPartials()).Return(new List<string>());
        }
开发者ID:ketiko,项目名称:SparkSense,代码行数:14,代码来源:ElementCompletionSetTests.cs


示例15: FindTokenSpanAtPosition

		/// <summary>
		/// Finds the span of completion text to replace and use for searching.
		/// </summary>
		ITrackingSpan FindTokenSpanAtPosition(ITrackingPoint point, ICompletionSession session, CompletionMode mode)
		{
			var end = session.TextView.Caret.Position.BufferPosition;
			var start = end;
			var ch = start.GetChar();
            while (start.Position > 0)
			{
				var temp = start - 1;
				ch = temp.GetChar();
				if (!(char.IsLetterOrDigit(ch) || ch == ':' || ch == '_') || ch == '"' || ch == '\'' || ch == '.')
					break;
				start = temp;
			}
			var span = Span.FromBounds(start.Position, end.Position);
			return start.Snapshot.CreateTrackingSpan(span, SpanTrackingMode.EdgeInclusive);
		}
开发者ID:mhusen,项目名称:Eto,代码行数:19,代码来源:XamlCompletionSource.cs


示例16: QuickInfoSession

		public QuickInfoSession(ITextView textView, ITrackingPoint triggerPoint, bool trackMouse, IIntellisensePresenterFactoryService intellisensePresenterFactoryService, Lazy<IQuickInfoSourceProvider, IOrderableContentTypeMetadata>[] quickInfoSourceProviders) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			if (intellisensePresenterFactoryService == null)
				throw new ArgumentNullException(nameof(intellisensePresenterFactoryService));
			if (quickInfoSourceProviders == null)
				throw new ArgumentNullException(nameof(quickInfoSourceProviders));
			Properties = new PropertyCollection();
			QuickInfoContent = new BulkObservableCollection<object>();
			TextView = textView;
			this.triggerPoint = triggerPoint;
			TrackMouse = trackMouse;
			this.intellisensePresenterFactoryService = intellisensePresenterFactoryService;
			this.quickInfoSourceProviders = quickInfoSourceProviders;
			TextView.Closed += TextView_Closed;
		}
开发者ID:0xd4d,项目名称:dnSpy,代码行数:18,代码来源:QuickInfoSession.cs


示例17: CompletionSession

		public CompletionSession(ITextView textView, ITrackingPoint triggerPoint, bool trackCaret, IIntellisensePresenterFactoryService intellisensePresenterFactoryService, Lazy<ICompletionSourceProvider, IOrderableContentTypeMetadata>[] completionSourceProviders) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			if (intellisensePresenterFactoryService == null)
				throw new ArgumentNullException(nameof(intellisensePresenterFactoryService));
			if (completionSourceProviders == null)
				throw new ArgumentNullException(nameof(completionSourceProviders));
			completionSets = new ObservableCollection<CompletionSet>();
			CompletionSets = new ReadOnlyObservableCollection<CompletionSet>(completionSets);
			Properties = new PropertyCollection();
			TextView = textView;
			this.triggerPoint = triggerPoint;
			this.intellisensePresenterFactoryService = intellisensePresenterFactoryService;
			this.completionSourceProviders = completionSourceProviders;
			//TODO: Use trackCaret
			TextView.Closed += TextView_Closed;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:19,代码来源:CompletionSession.cs


示例18: SignatureHelpSession

		public SignatureHelpSession(ITextView textView, ITrackingPoint triggerPoint, bool trackCaret, IIntellisensePresenterFactoryService intellisensePresenterFactoryService, Lazy<ISignatureHelpSourceProvider, IOrderableContentTypeMetadata>[] signatureHelpSourceProviders) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (triggerPoint == null)
				throw new ArgumentNullException(nameof(triggerPoint));
			if (intellisensePresenterFactoryService == null)
				throw new ArgumentNullException(nameof(intellisensePresenterFactoryService));
			if (signatureHelpSourceProviders == null)
				throw new ArgumentNullException(nameof(signatureHelpSourceProviders));
			Properties = new PropertyCollection();
			TextView = textView;
			this.triggerPoint = triggerPoint;
			this.trackCaret = trackCaret;
			this.intellisensePresenterFactoryService = intellisensePresenterFactoryService;
			this.signatureHelpSourceProviders = signatureHelpSourceProviders;
			signatures = new ObservableCollection<ISignature>();
			Signatures = new ReadOnlyObservableCollection<ISignature>(signatures);

			TextView.Closed += TextView_Closed;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:20,代码来源:SignatureHelpSession.cs


示例19: Model

        private Model(
            DisconnectedBufferGraph disconnectedBufferGraph,
            CompletionList originalList,
            ImmutableArray<PresentationItem> totalItems,
            ImmutableArray<PresentationItem> filteredItems,
            PresentationItem selectedItem,
            ImmutableArray<CompletionItemFilter> completionItemFilters,
            ImmutableDictionary<CompletionItemFilter, bool> filterState,
            IReadOnlyDictionary<CompletionItem, string> completionItemToFilterText,
            bool isHardSelection,
            bool isUnique,
            bool useSuggestionMode,
            PresentationItem suggestionModeItem,
            PresentationItem defaultSuggestionModeItem,
            CompletionTrigger trigger,
            ITrackingPoint commitSpanEndPoint,
            bool dismissIfEmpty)
        {
            Contract.ThrowIfNull(selectedItem);
            Contract.ThrowIfFalse(totalItems.Length != 0, "Must have at least one item.");
            Contract.ThrowIfFalse(filteredItems.Length != 0, "Must have at least one filtered item.");
            Contract.ThrowIfFalse(filteredItems.Contains(selectedItem) || defaultSuggestionModeItem == selectedItem, "Selected item must be in filtered items.");

            _disconnectedBufferGraph = disconnectedBufferGraph;
            this.OriginalList = originalList;
            this.TotalItems = totalItems;
            this.FilteredItems = filteredItems;
            this.FilterState = filterState;
            this.SelectedItem = selectedItem;
            this.CompletionItemFilters = completionItemFilters;
            this.CompletionItemToFilterText = completionItemToFilterText;
            this.IsHardSelection = isHardSelection;
            this.IsUnique = isUnique;
            this.UseSuggestionMode = useSuggestionMode;
            this.SuggestionModeItem = suggestionModeItem;
            this.DefaultSuggestionModeItem = defaultSuggestionModeItem;
            this.Trigger = trigger;
            this.CommitTrackingSpanEndPoint = commitSpanEndPoint;
            this.DismissIfEmpty = dismissIfEmpty;
        }
开发者ID:rgani,项目名称:roslyn,代码行数:40,代码来源:Model.cs


示例20: GetAnyCallNodeAboveTriggerPoint

    public static SyntaxNode GetAnyCallNodeAboveTriggerPoint(ITrackingPoint triggerPoint, ITextSnapshot snapshot, SyntaxTree parseTree) {
      Contract.Requires(snapshot != null);
      Contract.Requires(parseTree != null);
      Contract.Requires(triggerPoint != null);

      SyntaxNode syntaxRoot;
      if (!parseTree.TryGetRoot(out syntaxRoot))
        return null;

      var leafNode = syntaxRoot.FindToken(triggerPoint.GetPosition(snapshot), false);
      if (leafNode.IsKind(SyntaxKind.None))
        return null;

      //Is anyone in our ancestry a call node?
      var nodeInQuestion = leafNode.Parent;
      SyntaxNode ptn = null;

      while (nodeInQuestion != null) {
        //Is the node in question a node call?
        var asCall = nodeInQuestion as InvocationExpressionSyntax;
        if (asCall != null) {
          ptn = asCall;
          break;
        }

        var asCtorCall = nodeInQuestion as ObjectCreationExpressionSyntax;
        if (asCtorCall != null) {
          ptn = asCtorCall;
          break;
        }

        //Climb higher up our ancestry for the next iteration
        nodeInQuestion = nodeInQuestion.Parent;
      }

      //Did we successfully find a call node?
      return ptn;
    }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:38,代码来源:IntellisenseContractsHelper.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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