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

C# ITextView类代码示例

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

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



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

示例1: IsExpressionView

        /// <summary>
        /// Ideally we should be checking for both the correct content type and some tag to indicate
        /// that this is actually hosted in the report expression editor.  I can't find such a tag though
        /// so go with the lesser property of the content type matching
        /// </summary>
        bool IsExpressionView(ITextView textView)
        {
            // First step is to check for the correct content type.  
            if (!textView.TextBuffer.ContentType.IsOfType(RdlContentTypeName))
            {
                return false;
            }

            // Next dig into the shims and look for the report context GUID
            var vsTextBuffer = _vsEditorAdaptersFactoryService.GetBufferAdapter(textView.TextBuffer);
            if (vsTextBuffer == null)
            {
                return false;
            }

            var vsUserData = vsTextBuffer as IVsUserData;
            if (vsUserData == null)
            {
                return false;
            }

            try
            {
                var guid = ReportContextGuid;
                object data;
                return ErrorHandler.Succeeded(vsUserData.GetData(ref guid, out data)) && data != null;
            }
            catch
            {
                return false;
            }
        }
开发者ID:aesire,项目名称:VsVim,代码行数:37,代码来源:ReportDesignerUtil.cs


示例2: AbstractSnippetFunctionGenerateSwitchCases

 public AbstractSnippetFunctionGenerateSwitchCases(AbstractSnippetExpansionClient snippetExpansionClient, ITextView textView, ITextBuffer subjectBuffer, string caseGenerationLocationField, string switchExpressionField)
     : base(snippetExpansionClient, textView, subjectBuffer)
 {
     this.CaseGenerationLocationField = caseGenerationLocationField;
     this.SwitchExpressionField = (switchExpressionField.Length >= 2 && switchExpressionField[0] == '$' && switchExpressionField[switchExpressionField.Length - 1] == '$')
         ? switchExpressionField.Substring(1, switchExpressionField.Length - 2) : switchExpressionField;
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:AbstractSnippetFunctionGenerateSwitchCases.cs


示例3: SetOwner

		/// <summary>
		/// Sets the owner and must only be called once
		/// </summary>
		/// <param name="textView">Text view</param>
		/// <param name="owner">Owner</param>
		public static void SetOwner(ITextView textView, ICustomLineNumberMarginOwner owner) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (owner == null)
				throw new ArgumentNullException(nameof(owner));
			GetMargin(textView).SetOwner(owner);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:ICustomLineNumberMargin.cs


示例4: CreateSuggestedActionsSource

        public ISuggestedActionsSource CreateSuggestedActionsSource(ITextView textView, ITextBuffer textBuffer)
        {
            Contract.ThrowIfNull(textView);
            Contract.ThrowIfNull(textBuffer);

            return new Source(this, textView, textBuffer);
        }
开发者ID:JackWangCUMT,项目名称:roslyn,代码行数:7,代码来源:SuggestedActionsSourceProvider.cs


示例5: ViewSpanChangedEventSource

 public ViewSpanChangedEventSource(ITextView textView, TaggerDelay textChangeDelay, TaggerDelay scrollChangeDelay)
 {
     Debug.Assert(textView != null);
     _textView = textView;
     _textChangeDelay = textChangeDelay;
     _scrollChangeDelay = scrollChangeDelay;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:7,代码来源:TaggerEventSources.ViewSpanChangedEventSource.cs


示例6: AddInstance

		/// <summary>
		/// Adds the <see cref="ScriptControlVM"/> instance to the <see cref="ITextView"/> properties
		/// </summary>
		/// <param name="vm">Script control</param>
		/// <param name="textView">REPL editor text view</param>
		public static void AddInstance(ScriptControlVM vm, ITextView textView) {
			if (vm == null)
				throw new ArgumentNullException(nameof(vm));
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			textView.Properties.AddProperty(Key, vm);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:RoslynReplEditorUtils.cs


示例7: TryGetController

        public bool TryGetController(ITextView textView, ITextBuffer subjectBuffer, out Controller controller)
        {
            AssertIsForeground();

            // check whether this feature is on.
            if (!subjectBuffer.GetOption(InternalFeatureOnOffOptions.CompletionSet))
            {
                controller = null;
                return false;
            }

            // If we don't have a presenter, then there's no point in us even being involved.  Just
            // defer to the next handler in the chain.

            // Also, if there's an inline rename session then we do not want completion.
            if (_completionPresenter == null || _inlineRenameService.ActiveSession != null)
            {
                controller = null;
                return false;
            }

            var autobraceCompletionCharSet = GetAllAutoBraceCompletionChars(subjectBuffer.ContentType);
            controller = Controller.GetInstance(
                textView, subjectBuffer,
                _editorOperationsFactoryService, _undoHistoryRegistry, _completionPresenter,
                new AggregateAsynchronousOperationListener(_asyncListeners, FeatureAttribute.CompletionSet),
                _allCompletionProviders, autobraceCompletionCharSet);

            return true;
        }
开发者ID:GeertVL,项目名称:roslyn,代码行数:30,代码来源:AsyncCompletionService.cs


示例8: IntellisenseController

        /// <summary>
        /// Attaches events for invoking Statement completion 
        /// </summary>
        public IntellisenseController(IntellisenseControllerProvider provider, ITextView textView) {
            _textView = textView;
            _provider = provider;
            textView.Properties.AddProperty(typeof(IntellisenseController), this);  // added so our key processors can get back to us

            _intelliSenseManager = new IntelliSenseManager(provider._CompletionBroker, provider.ServiceProvider, null, textView);
        }
开发者ID:vairam-svs,项目名称:poshtools,代码行数:10,代码来源:IntellisenseController.cs


示例9: Detach

 public void Detach(ITextView detacedTextView)
 {
     if (textView == detacedTextView)
     {
         textDocument.DirtyStateChanged -= OnDocumentDirtyStateChanged;
     }
 }
开发者ID:RC1140,项目名称:Encourage,代码行数:7,代码来源:EncourageIntellisenseController.cs


示例10: CompletionModelManager

 public CompletionModelManager(ITextView textView, ICompletionBroker completionBroker, CompletionProviderService completionProviderService)
 {
     _textView = textView;
     _textView.TextBuffer.PostChanged += OnTextBufferOnPostChanged;
     _completionBroker = completionBroker;
     _completionProviderService = completionProviderService;
 }
开发者ID:Samana,项目名称:HlslTools,代码行数:7,代码来源:CompletionModelManager.cs


示例11: GenerateHtmlFragmentCore

		string GenerateHtmlFragmentCore(NormalizedSnapshotSpanCollection spans, ITextView textView, string delimiter, CancellationToken cancellationToken) {
			ISynchronousClassifier classifier = null;
			try {
				int tabSize;
				IClassificationFormatMap classificationFormatMap;
				if (textView != null) {
					classifier = synchronousViewClassifierAggregatorService.GetSynchronousClassifier(textView);
					classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(textView);
					tabSize = textView.Options.GetTabSize();
				}
				else {
					classifier = spans.Count == 0 ? null : synchronousClassifierAggregatorService.GetSynchronousClassifier(spans[0].Snapshot.TextBuffer);
					classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.TextEditor);
					tabSize = defaultTabSize;
				}
				tabSize = OptionsHelpers.FilterTabSize(tabSize);

				var builder = new HtmlBuilder(classificationFormatMap, delimiter, tabSize);
				if (spans.Count != 0)
					builder.Add(classifier, spans, cancellationToken);
				return builder.Create();
			}
			finally {
				(classifier as IDisposable)?.Dispose();
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:26,代码来源:HtmlBuilderService.cs


示例12: TypeCharFilter

        internal TypeCharFilter(IVsTextView adapter, ITextView textView, TypingSpeedMeter adornment)
        {
            this.textView = textView;
            this.adornment = adornment;

            adapter.AddCommandFilter(this, out nextCommandHandler);
        }
开发者ID:Konctantin,项目名称:VS_SDK_samples,代码行数:7,代码来源:CommandFilter.cs


示例13: Detach

 public void Detach(ITextView detacedTextView)
 {
     if (textView == detacedTextView)
     {
         textView = null;
     }
 }
开发者ID:fazueu,项目名称:Encourage,代码行数:7,代码来源:EncourageIntellisenseController.cs


示例14: SemanticErrorTagger

 public SemanticErrorTagger(ITextView textView, BackgroundParser backgroundParser,
     IHlslOptionsService optionsService)
     : base(PredefinedErrorTypeNames.CompilerError, textView, optionsService)
 {
     backgroundParser.SubscribeToThrottledSemanticModelAvailable(BackgroundParserSubscriptionDelay.Medium,
         async x => await InvalidateTags(x.Snapshot, x.CancellationToken));
 }
开发者ID:tgjones,项目名称:HlslTools,代码行数:7,代码来源:SemanticErrorTagger.cs


示例15: AbstractSnippetExpansionClient

 public AbstractSnippetExpansionClient(Guid languageServiceGuid, ITextView textView, ITextBuffer subjectBuffer, IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
 {
     this.LanguageServiceGuid = languageServiceGuid;
     this.TextView = textView;
     this.SubjectBuffer = subjectBuffer;
     this.EditorAdaptersFactoryService = editorAdaptersFactoryService;
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:7,代码来源:AbstractSnippetExpansionClient.cs


示例16: ShowContextMenuCommand

        public ShowContextMenuCommand(ITextView textView, Guid packageGuid, Guid cmdSetGuid, int menuId)
            : base(textView, new CommandId(VSConstants.VSStd2K, (int)VSConstants.VSStd2KCmdID.SHOWCONTEXTMENU), false) {

            _cmdSetGuid = cmdSetGuid;
            _packageGuid = packageGuid;
            _menuId = menuId;
        }
开发者ID:AlexanderSher,项目名称:RTVS-Old,代码行数:7,代码来源:ShowContextMenuCommand.cs


示例17: SnapshotSpanNavigateToTarget

        public SnapshotSpanNavigateToTarget(ITextView textView, SnapshotSpan snapshotSpan)
        {
            Contract.Requires<ArgumentNullException>(textView != null, "textView");

            this._textView = textView;
            this._snapshotSpan = snapshotSpan;
        }
开发者ID:sebandraos,项目名称:LangSvcV2,代码行数:7,代码来源:SnapshotSpanNavigateToTarget.cs


示例18: TryGetInstance

		/// <summary>
		/// Returns the <see cref="ScriptControlVM"/> instance if it has been added by <see cref="AddInstance(ScriptControlVM, ITextView)"/>
		/// </summary>
		/// <param name="textView">Text view</param>
		/// <returns></returns>
		public static ScriptControlVM TryGetInstance(ITextView textView) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			ScriptControlVM vm;
			textView.Properties.TryGetProperty(Key, out vm);
			return vm;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:12,代码来源:RoslynReplEditorUtils.cs


示例19: ImportSmartTagAction

 /// <summary>
 /// Creates a new smart tag action for a "from fob import oar" smart tag.
 /// </summary>
 public ImportSmartTagAction(string fromName, string name, ITextBuffer buffer, ITextView view, IServiceProvider serviceProvider)
     : base(serviceProvider, RefactoringIconKind.AddUsing) {
     FromName = fromName;
     Name = name;
     _buffer = buffer;
     _view = view;
 }
开发者ID:wenh123,项目名称:PTVS,代码行数:10,代码来源:ImportSmartTagAction.cs


示例20: GetSmartTagActions

        public IEnumerable<ISmartTagAction> GetSmartTagActions(ParseItem item, int position, ITrackingSpan itemTrackingSpan, ITextView view)
        {
            Declaration dec = (Declaration)item;

            if (!item.IsValid || position > dec.Colon.Start)
                yield break;

            RuleBlock rule = dec.FindType<RuleBlock>();
            if (!rule.IsValid)
                yield break;

            ICssSchemaInstance schema = CssSchemaManager.SchemaManager.GetSchemaRootForBuffer(itemTrackingSpan.TextBuffer);

            if (!dec.IsVendorSpecific())
            {
                IEnumerable<Declaration> vendors = VendorHelpers.GetMatchingVendorEntriesInRule(dec, rule, schema);
                if (vendors.Any(v => v.Start > dec.Start))
                {
                    yield return new VendorOrderSmartTagAction(itemTrackingSpan, vendors.Last(), dec);
                }
            }
            else
            {
                ICssCompletionListEntry entry = VendorHelpers.GetMatchingStandardEntry(dec, schema);
                if (entry != null && !rule.Declarations.Any(d => d.PropertyName != null && d.PropertyName.Text == entry.DisplayText))
                {
                    yield return new MissingStandardSmartTagAction(itemTrackingSpan, dec, entry.DisplayText);
                }
            }
        }
开发者ID:NickCraver,项目名称:WebEssentials2013,代码行数:30,代码来源:VendorOrderSmartTagProvider.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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