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


C# ITrackingPoint类代码示例

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


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


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