本文整理汇总了C#中IQuickInfoSession.CreateTrackingSpan方法的典型用法代码示例。如果您正苦于以下问题:C# IQuickInfoSession.CreateTrackingSpan方法的具体用法?C# IQuickInfoSession.CreateTrackingSpan怎么用?C# IQuickInfoSession.CreateTrackingSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuickInfoSession
的用法示例。
在下文中一共展示了IQuickInfoSession.CreateTrackingSpan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnalyzeExpression
private ExpressionAnalysis AnalyzeExpression(IQuickInfoSession session) {
return VsProjectAnalyzer.AnalyzeExpression(
_textBuffer.CurrentSnapshot,
session.CreateTrackingSpan(_textBuffer),
false
);
}
示例2: AugmentQuickInfoSession
public void AugmentQuickInfoSession(IQuickInfoSession session, System.Collections.Generic.IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
{
var textBuffer = session.TextView.TextBuffer;
var vars = _provider._Analyzer.AnalyzeExpression(
textBuffer.CurrentSnapshot,
textBuffer,
session.CreateTrackingSpan(textBuffer)
);
applicableToSpan = vars.Span;
if (String.IsNullOrEmpty(vars.Expression)) {
return;
}
bool first = true;
var result = new StringBuilder();
int count = 0;
List<IAnalysisValue> listVars = new List<IAnalysisValue>(vars.Values);
HashSet<string> descriptions = new HashSet<string>();
bool multiline = false;
foreach (var v in listVars) {
string description = null;
if (listVars.Count == 1) {
if (v.Description != null) {
description = v.Description;
}
} else {
if (v.ShortDescription != null) {
description = v.ShortDescription;
}
}
if (descriptions.Add(description)) {
if (first) {
first = false;
} else {
if (result.Length == 0 || result[result.Length - 1] != '\n') {
result.Append(", ");
} else {
multiline = true;
}
}
result.Append(description);
count++;
}
}
if (multiline) {
result.Insert(0, vars.Expression + ": " + Environment.NewLine);
} else {
result.Insert(0, vars.Expression + ": ");
}
quickInfoContent.Add(result.ToString());
}
示例3: AugmentQuickInfoSession
public void AugmentQuickInfoSession(IQuickInfoSession session, System.Collections.Generic.IList<object> quickInfoContent, out ITrackingSpan applicableToSpan)
{
if (_curSession != null && !_curSession.IsDismissed) {
_curSession.Dismiss();
_curSession = null;
}
_curSession = session;
_curSession.Dismissed += CurSessionDismissed;
var vars = _textBuffer.CurrentSnapshot.AnalyzeExpression(
session.CreateTrackingSpan(_textBuffer),
false
);
AugmentQuickInfoWorker(vars, quickInfoContent, out applicableToSpan);
}