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


C# ITextView类代码示例

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


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


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