本文整理汇总了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;
}
}
示例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;
}
示例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);
}
示例4: CreateSuggestedActionsSource
public ISuggestedActionsSource CreateSuggestedActionsSource(ITextView textView, ITextBuffer textBuffer)
{
Contract.ThrowIfNull(textView);
Contract.ThrowIfNull(textBuffer);
return new Source(this, textView, textBuffer);
}
示例5: ViewSpanChangedEventSource
public ViewSpanChangedEventSource(ITextView textView, TaggerDelay textChangeDelay, TaggerDelay scrollChangeDelay)
{
Debug.Assert(textView != null);
_textView = textView;
_textChangeDelay = textChangeDelay;
_scrollChangeDelay = scrollChangeDelay;
}
示例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);
}
示例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;
}
示例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);
}
示例9: Detach
public void Detach(ITextView detacedTextView)
{
if (textView == detacedTextView)
{
textDocument.DirtyStateChanged -= OnDocumentDirtyStateChanged;
}
}
示例10: CompletionModelManager
public CompletionModelManager(ITextView textView, ICompletionBroker completionBroker, CompletionProviderService completionProviderService)
{
_textView = textView;
_textView.TextBuffer.PostChanged += OnTextBufferOnPostChanged;
_completionBroker = completionBroker;
_completionProviderService = completionProviderService;
}
示例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();
}
}
示例12: TypeCharFilter
internal TypeCharFilter(IVsTextView adapter, ITextView textView, TypingSpeedMeter adornment)
{
this.textView = textView;
this.adornment = adornment;
adapter.AddCommandFilter(this, out nextCommandHandler);
}
示例13: Detach
public void Detach(ITextView detacedTextView)
{
if (textView == detacedTextView)
{
textView = null;
}
}
示例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));
}
示例15: AbstractSnippetExpansionClient
public AbstractSnippetExpansionClient(Guid languageServiceGuid, ITextView textView, ITextBuffer subjectBuffer, IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
{
this.LanguageServiceGuid = languageServiceGuid;
this.TextView = textView;
this.SubjectBuffer = subjectBuffer;
this.EditorAdaptersFactoryService = editorAdaptersFactoryService;
}