本文整理汇总了C#中Dev2.Studio.Core.Interfaces.IntellisenseProviderContext.FindTextToSearch方法的典型用法代码示例。如果您正苦于以下问题:C# IntellisenseProviderContext.FindTextToSearch方法的具体用法?C# IntellisenseProviderContext.FindTextToSearch怎么用?C# IntellisenseProviderContext.FindTextToSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dev2.Studio.Core.Interfaces.IntellisenseProviderContext
的用法示例。
在下文中一共展示了IntellisenseProviderContext.FindTextToSearch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindTextTestHelper
private static void FindTextTestHelper(int caretPosition, string inputText, string expectedResult)
{
var context = new IntellisenseProviderContext
{
CaretPosition = caretPosition,
InputText = inputText,
DesiredResultSet = IntellisenseDesiredResultSet.Default
};
var search = context.FindTextToSearch();
Assert.AreEqual(expectedResult, search);
}
示例2: GetIntellisenseResults
public IList<IntellisenseProviderResult> GetIntellisenseResults(IntellisenseProviderContext context)
{
if(context == null)
{
return new List<IntellisenseProviderResult>();
}
var caretPosition = context.CaretPosition;
var inputText = context.InputText ?? string.Empty;
var parseEventLog = _syntaxTreeBuilderHelper.EventLog;
var intellisenseDesiredResultSet = context.DesiredResultSet;
if((caretPosition == 0 || string.IsNullOrEmpty(inputText))
&& intellisenseDesiredResultSet != IntellisenseDesiredResultSet.EntireSet)
{
return EmptyResults;
}
if(context.IsInCalculateMode)
{
if(intellisenseDesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
{
if(parseEventLog != null) parseEventLog.Clear();
if(_syntaxTreeBuilderHelper.EventLog != null && _syntaxTreeBuilderHelper.HasEventLogs)
{
List<IntellisenseProviderResult> tResults = new List<IntellisenseProviderResult>();
tResults.AddRange(IntellisenseResult);
return EvaluateEventLogs(tResults, inputText);
}
return IntellisenseResult;
}
Token[] tokens;
if(intellisenseDesiredResultSet == IntellisenseDesiredResultSet.ClosestMatch)
{
var searchText = context.FindTextToSearch();
_syntaxTreeBuilderHelper.Build(searchText, true, out tokens);
string sub = string.IsNullOrEmpty(searchText) ? inputText : searchText;
List<IntellisenseProviderResult> subResults = IntellisenseResult.Where(t => t.Name.StartsWith(sub)).ToList();
if(_syntaxTreeBuilderHelper.EventLog != null && _syntaxTreeBuilderHelper.HasEventLogs)
{
return EvaluateEventLogs(subResults, inputText);
}
return subResults;
}
_syntaxTreeBuilderHelper.Build(inputText, false, out tokens);
if(_syntaxTreeBuilderHelper.HasEventLogs)
{
return EvaluateEventLogs(inputText);
}
}
return EmptyResults;
}
示例3: GetIntellisenseResultsImpl
public IList<IIntellisenseResult> GetIntellisenseResultsImpl(IntellisenseProviderContext context)
{
string searchText = context.FindTextToSearch();
var results = new List<IIntellisenseResult>();
if (context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
{
results.AddRange(IntellisenseResults);
}
else if (!InLiteralRegion(context.InputText, context.CaretPosition))
{
var filteredResults = IntellisenseResults.Where(i => i.Option.DisplayValue.ToLower().StartsWith(searchText.ToLower()));
results.AddRange(filteredResults);
}
return results;
}